Skip to content

llisaeva/Tic-Tac-Toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic-Tac-Toe

animated

A Tic-Tac-Toe game where the user can play with a friend, with a bot or watch 2 bots play against each other.

The bot moves strategically, its opponent can either lose or draw.

Tools used

Table of Contents

  1. Game Window
  2. Settings Window
  3. How the Game Works
  4. Download and Run

Game Window

The game starts in Player vs Player mode. The top corners show the names and scores for Player X and Player O. You can change the color themes by clicking on the swatches on the bottom left corner.

animated

Settings Window

Select one of 3 game modes:

  • Player vs Player (the default mode) - have full control over placing the marks on the board.
  • Player vs Master – play against an unbeatable bot. Choose the mark that the bot will play with. The ? option will assign a random mark for Master on each replay.
  • Master vs Master – watch two bots play.

You can also click on the player names to change them.



How the Game Works

Behind the scenes, each cell in the grid has an associated code (shown in image). 3 matching digits from different codes identify a winning condition. Master uses these codes to understand the state of the board.
The optimal tic-tac-toe strategy used to create Master’s move decisions is described here.

Download and Run

Prerequisites: JRE - click here for installation steps. Make sure to set the JAVA_HOME system variable.

JavaFX - click here Put the the path to the lib folder in the compile and run scripts.

Download and unzip the project.

Run Command:

    ./compile
    ./run