mirror of
https://github.com/2OOP/pism.git
synced 2026-02-04 19:04:49 +00:00
Changed formatting of string to be easier to read
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -42,9 +42,9 @@ public class Main {
|
||||
|
||||
console.print();
|
||||
|
||||
while (console.next()) {
|
||||
do {
|
||||
console.print();
|
||||
}
|
||||
} while (console.next());
|
||||
|
||||
console.print();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user