interface improvements

This commit is contained in:
Lukian LEIZOUR 2024-02-28 18:10:57 +01:00
parent 561069b074
commit b4f887e0c1
3 changed files with 29 additions and 8 deletions

View file

@ -39,7 +39,7 @@ public class AppLaser {
int i = 0;
while (!universe.isSolved()) {
System.out.printf("i: %d, j: %d, dir: %d, choice: %d, possible: %d\n", currentState.pos_i, currentState.pos_j, currentState.direction, currentState.nb_choix, universe.possibleChoices(currentState));
//System.out.printf("i: %d, j: %d, dir: %d, choice: %d, possible: %d\n", currentState.pos_i, currentState.pos_j, currentState.direction, currentState.nb_choix, universe.possibleChoices(currentState));
if (universe.canEvolve(currentState)) {
stack.push(currentState.copy(universe.possibleChoices(currentState)));
@ -57,7 +57,6 @@ public class AppLaser {
}
System.out.println("\n\n");
universe.print();
}
}

View file

@ -153,7 +153,7 @@ public class Universe {
// adding the miror
switch (c) {
/*switch (c) {
case 1:
this.grid[i][j] = 1;
break;
@ -167,7 +167,12 @@ public class Universe {
break;
default:
}
}*/
if (c == 1 && (d == 10 || d == 11)) this.grid[i][j] = 1;
if (c == 1 && (d == 12 || d == 13)) this.grid[i][j] = 2;
if ((c == 3 && d == 10) || (c == 3 && d == 11) || (c == 2 && d == 12) || (c == 2 && d == 13)) this.grid[i][j] = 3;
if ((c == 2 && d == 10) || (c == 2 && d == 11) || (c == 3 && d == 12) || (c == 3 && d == 13)) this.grid[i][j] = 4;
// changing the position of the situation
@ -215,8 +220,24 @@ public class Universe {
System.out.printf(" X");
break;
case 0:
System.out.printf(" ");
break;
case 1:
System.out.printf(" +");
System.out.printf(" |");
break;
case 2:
System.out.printf(" -");
break;
case 3:
System.out.printf(" /");
break;
case 4:
System.out.printf(" \\");
break;
case 10:

View file

@ -28,9 +28,10 @@ Le truc avec la pile:
types de cases:
- 0 case vide
- -1 obstacle
- 1 laser
- 2 miroir gauche
- 3 miroir droite
- 1 laser 1
- 2 laser 2
- 3 miroir 1
- 4 miroir 2
- 10 départ nord
- 11 départ sud
- 12 départ est