The first player automatically becomes X's. X's and Os appear on alternate clicks. An alert pops up if one player wins.
Run the following commands in Terminal:
$ git clone
this repository$ cd tic-tac-toe
$ open index.html
Spec | Input | Output |
---|---|---|
If a player clicks on a box in the game board, an X appears. | click 'Spot 3' | x |
When the next player clicks on a box, an O appears. | click 'Spot 6' | o |
If there are 3 Xs or Os in a row, column or diagonally, an alert will appear saying "You win! | X X X | You win! |
- The alerts for winner contain the column name instead of the player name.
- There is no alert for a tie game.
Get more comfortable writing more complex JavaScript applications.
Add alerts that say which player wins, and alerts for tie games. Add more styling.
If you have any updates, questions, or suggestions please contact Margaret or make a contribution.
- HTML
- CSS
- Bootstrap
- JavaScript
- jQuery
This software is licensed under the MIT license.
Copyright (c) 2017 Margaret Berry and Dan Kiss