This is a project from Hyperskill
Everybody remembers this paper-and-pencil game from childhood: Tic-Tac-Toe, also known as Noughts and crosses or Xs and Os. A single mistake usually costs you the game, but thankfully it is simple enough that most players discover the best strategy quickly. Let’s program Tic-Tac-Toe and get playing!
To play enter in command line:
java -jar target/tic-tac-toe-with-ai-1.0-SNAPSHOT.jar
You'll be prompted to input command in the following format:
start x-player o-player
or
exit
where x-player and o-player can be:
- user - human player,
- easy - ai that makes random moves
- medium - slightly harder to beat ai
- hard - ai that moves based on minimax algorithm
At each stage you enter coordinates of the move (y and x):
(1 1) (1 2) (1 3)
(2 1) (2 2) (2 3)
(3 1) (3 2) (3 3)