Skip to content
Snippets Groups Projects
Commit 94f9d47c authored by Goik Martin's avatar Goik Martin
Browse files

Cosmetics

parent 5442e9c7
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@ package de.hdm_stuttgart.mi.sd1.tictactoe;
import java.util.Scanner;
/**
* Playing Tic-tac-toe with two players.
* Tic-tac-toe human vs. computer.
*
*/
public class TicTacToe {
......@@ -20,16 +20,20 @@ public class TicTacToe {
System.out.println("Who is going to start? " +
Player.YOU.ordinal() + " = " + Player.YOU.nickname +
", other = " + Player.COM.nickname);
", " + Player.COM.ordinal() + " = " + Player.COM.nickname);
final int firstPlayer = scan.nextShort();
final Board board;
if (Player.YOU.ordinal() == firstPlayer) {
board = new Board(Player.YOU);
} else {
} else if (Player.COM.ordinal() == firstPlayer){
board = new Board(Player.COM);
board.nextPerfectMove();
} else {
board = null;
System.err.println("Wrong choice, you may re-start this program");
System.exit(1);
}
board.print(true, true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment