interface improvements
This commit is contained in:
parent
561069b074
commit
b4f887e0c1
3 changed files with 29 additions and 8 deletions
|
@ -39,7 +39,7 @@ public class AppLaser {
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (!universe.isSolved()) {
|
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)) {
|
if (universe.canEvolve(currentState)) {
|
||||||
stack.push(currentState.copy(universe.possibleChoices(currentState)));
|
stack.push(currentState.copy(universe.possibleChoices(currentState)));
|
||||||
|
@ -57,7 +57,6 @@ public class AppLaser {
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println("\n\n");
|
System.out.println("\n\n");
|
||||||
|
|
||||||
universe.print();
|
universe.print();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,7 +153,7 @@ public class Universe {
|
||||||
|
|
||||||
// adding the miror
|
// adding the miror
|
||||||
|
|
||||||
switch (c) {
|
/*switch (c) {
|
||||||
case 1:
|
case 1:
|
||||||
this.grid[i][j] = 1;
|
this.grid[i][j] = 1;
|
||||||
break;
|
break;
|
||||||
|
@ -167,7 +167,12 @@ public class Universe {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
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
|
// changing the position of the situation
|
||||||
|
|
||||||
|
@ -215,8 +220,24 @@ public class Universe {
|
||||||
System.out.printf(" X");
|
System.out.printf(" X");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 0:
|
||||||
|
System.out.printf(" ");
|
||||||
|
break;
|
||||||
|
|
||||||
case 1:
|
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;
|
break;
|
||||||
|
|
||||||
case 10:
|
case 10:
|
||||||
|
|
7
algo.txt
7
algo.txt
|
@ -28,9 +28,10 @@ Le truc avec la pile:
|
||||||
types de cases:
|
types de cases:
|
||||||
- 0 case vide
|
- 0 case vide
|
||||||
- -1 obstacle
|
- -1 obstacle
|
||||||
- 1 laser
|
- 1 laser 1
|
||||||
- 2 miroir gauche
|
- 2 laser 2
|
||||||
- 3 miroir droite
|
- 3 miroir 1
|
||||||
|
- 4 miroir 2
|
||||||
- 10 départ nord
|
- 10 départ nord
|
||||||
- 11 départ sud
|
- 11 départ sud
|
||||||
- 12 départ est
|
- 12 départ est
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue