Skip to content

topher6345/tic-tac-toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic Tac Toe

Play Tic-tac-toe in your browser.

I wrote this to learn React Hooks

This project was bootstrapped with Create React App.

Features

  • 4 difficulty modes HARD to EASY
  • Game history with win percentage
  • Sounds

Difficulty Modes

HARD will try to block your wins the best it can and seize the center piece on first turn if available.

MEDIUM will play the HARD strategy 67% of the time and the last 33% will choose a random piece (simulating a careless player)

EASY #1 will predictably choose the first available square starting from the top left and going down by row

EASY #2 will predictably choose the first available square starting from the bottom right and going up by row

Game History

Records the winner of the game, what strategy you played against, and the rolling win percentage.

Sounds

There are 6 sounds in the game for the following events:

Project structure

Everything is one file App.js and duplication is tolerated.

Available Scripts

In the project directory, you can run:

yarn start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

yarn deploy

Deploys the app using (gh-pages)[https://github.com/tschaub/gh-pages]

Deployment

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

yarn build fails to minify

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify