Change coordinate values from (0 -> n-1) to (1, n)

This commit is contained in:
Dorian HAMDANI
2025-04-14 11:01:43 +02:00
parent c0517b8f1e
commit 9facd76517
2 changed files with 4 additions and 4 deletions

View File

@@ -45,14 +45,14 @@ public class ConsoleRenderer extends GomokuRenderer {
System.out.print(" " + c + " |");
}
}
System.out.println(" " + i);
System.out.println(" " + (i + 1));
System.out.println(horizontalLine);
}
System.out.print("X");
for (int i = 0; i < width; i++) {
for (int i = 1; i <= width; i++) {
System.out.print(String.format(" %-2d ", i));
}
System.out.println("");
System.out.println();
}

View File

@@ -62,7 +62,7 @@ public class Human extends Player {
}
} while (!pass);
cell = board.get(x, y);
cell = board.get(x - 1, y - 1);
pass = cell == null ? false : cell.isPlayable();
if (!pass) {
System.out.println("Cette case n'est pas jouable !");