mirror of
https://github.com/2OOP/pism.git
synced 2026-02-04 10:54:51 +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;
|
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();
|
String modeString = scanner.nextLine();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -42,9 +42,9 @@ public class Main {
|
|||||||
|
|
||||||
console.print();
|
console.print();
|
||||||
|
|
||||||
while (console.next()) {
|
do {
|
||||||
console.print();
|
console.print();
|
||||||
}
|
} while (console.next());
|
||||||
|
|
||||||
console.print();
|
console.print();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,10 +107,10 @@ public class TicTacToe extends GameBase implements Runnable {
|
|||||||
movesLeft--;
|
movesLeft--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method copies the board, mainly for AI use.
|
||||||
|
*/
|
||||||
public TicTacToe copyBoard() {
|
public TicTacToe copyBoard() {
|
||||||
/**
|
|
||||||
* This method copies the board, mainly for AI use.
|
|
||||||
*/
|
|
||||||
TicTacToe clone = new TicTacToe(players[0].name(), players[1].name());
|
TicTacToe clone = new TicTacToe(players[0].name(), players[1].name());
|
||||||
System.arraycopy(this.grid, 0, clone.grid, 0, this.grid.length);
|
System.arraycopy(this.grid, 0, clone.grid, 0, this.grid.length);
|
||||||
clone.movesLeft = this.movesLeft;
|
clone.movesLeft = this.movesLeft;
|
||||||
|
|||||||
Reference in New Issue
Block a user