Skip to content

lexei/tic-tac-toe-with-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic Tac Toe with AI

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)

About

Tic-Tac-Toe with AI project from Hyperskill

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages