couleur et affichage
This commit is contained in:
@@ -29,17 +29,27 @@ public class ConsoleRenderer extends GomokuRenderer {
|
|||||||
System.out.println(horizontalLine);
|
System.out.println(horizontalLine);
|
||||||
for (int i = 0; i < height; i++) {
|
for (int i = 0; i < height; i++) {
|
||||||
System.out.print("|");
|
System.out.print("|");
|
||||||
System.out.print(board[i]);
|
for (int j=0; j<width; j++) {
|
||||||
System.out.println("|");
|
System.out.print(" "+board[i].charAt(j)+" |");
|
||||||
|
}
|
||||||
|
System.out.println(" "+i);
|
||||||
|
System.out.println(horizontalLine);
|
||||||
|
}
|
||||||
|
System.out.print(" ");
|
||||||
|
for (int i = 0; i < height; i++) {
|
||||||
|
if(i<10) {
|
||||||
|
System.out.print(" "+i+" ");
|
||||||
|
} else {
|
||||||
|
System.out.print(" "+i+" ");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
System.out.println(horizontalLine);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getHorizontalLine() {
|
private String getHorizontalLine() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("+");
|
sb.append("+");
|
||||||
for (int i = 0; i < game.getBoard().getWidth(); i++) {
|
for (int i = 0; i < game.getBoard().getWidth()*4-1; i++) {
|
||||||
sb.append("-");
|
sb.append("-");
|
||||||
}
|
}
|
||||||
sb.append("+");
|
sb.append("+");
|
||||||
|
|||||||
@@ -226,10 +226,10 @@ public class GomokuGame {
|
|||||||
char c;
|
char c;
|
||||||
switch (board.get(i, j).getState()) {
|
switch (board.get(i, j).getState()) {
|
||||||
case BLACK:
|
case BLACK:
|
||||||
c = 'X';
|
c = '\u274C';
|
||||||
break;
|
break;
|
||||||
case WHITE:
|
case WHITE:
|
||||||
c = 'O';
|
c = '\uD83D';
|
||||||
break;
|
break;
|
||||||
case NIL:
|
case NIL:
|
||||||
c = '.';
|
c = '.';
|
||||||
|
|||||||
Reference in New Issue
Block a user