Changed formatting of string to be easier to read

This commit is contained in:
lieght
2025-09-17 12:42:18 +02:00
parent 853c9f5c73
commit e1f2fe38e5
3 changed files with 12 additions and 6 deletions

View File

@@ -20,7 +20,13 @@ public class ConsoleGui {
int mode = -1;
System.out.printf("1. player vs player\n2. player vs ai\n3. ai vs player\n4. ai v ai\nChoose mode (default is 1): ");
System.out.print(
"""
1. player vs player
2. player vs ai
3. ai vs player
4. ai v ai
Choose mode (default is 1):\s""");
String modeString = scanner.nextLine();
try {

View File

@@ -42,9 +42,9 @@ public class Main {
console.print();
while (console.next()) {
do {
console.print();
}
} while (console.next());
console.print();
}

View File

@@ -107,10 +107,10 @@ public class TicTacToe extends GameBase implements Runnable {
movesLeft--;
}
/**
* This method copies the board, mainly for AI use.
*/
public TicTacToe copyBoard() {
/**
* This method copies the board, mainly for AI use.
*/
TicTacToe clone = new TicTacToe(players[0].name(), players[1].name());
System.arraycopy(this.grid, 0, clone.grid, 0, this.grid.length);
clone.movesLeft = this.movesLeft;