All Projects → getify → tic-tac-toe-workshop

getify / tic-tac-toe-workshop

Licence: other
Workshop files for building tic-tac-toe in JS and <canvas>

Making A Game: Tic-Tac-Toe

This is a set of workshop files for writing (parts of) a JS + <canvas> Tic-Tac-Toe game.

The workshop is organized into multiple steps, each in their own branch:

  • Step 1: drawing the grid lines
  • Step 2: drawing the X's and O's
  • Step 3: detecting and showing a win or a tie
  • Step 4: adding a computer player
  • Final: final solution branch

Go through the steps in order, and compare your code to the beginning of each next-step before moving on, to make sure you're getting everything in the right place.

Extra Credit

Things you can consider adding to this game to make it more fun to play:

  • Add buttons/controls to select "2-player", "Easy Computer Mode", or "Hard Computer Mode"
  • Add a "reset game" button so you can start a new game
  • Add score tracking between X's and O's

License

The code and all the documentation are released under the MIT license.

http://getify.mit-license.org/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].