couleur et affichage

This commit is contained in:
Cyprien111
2025-04-14 09:36:45 +02:00
parent 0b7eea162d
commit 87aee9b1d7
2 changed files with 16 additions and 6 deletions

View File

@@ -29,17 +29,27 @@ public class ConsoleRenderer extends GomokuRenderer {
System.out.println(horizontalLine);
for (int i = 0; i < height; i++) {
System.out.print("|");
System.out.print(board[i]);
System.out.println("|");
for (int j=0; j<width; j++) {
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+" ");
}
}
}
private String getHorizontalLine() {
StringBuilder sb = new StringBuilder();
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("+");

View File

@@ -226,10 +226,10 @@ public class GomokuGame {
char c;
switch (board.get(i, j).getState()) {
case BLACK:
c = 'X';
c = '\u274C';
break;
case WHITE:
c = 'O';
c = '\uD83D';
break;
case NIL:
c = '.';