- Introduction
- Technologies
- Set Up
- Deployment Link
- Features
- Organizational Resources
- Future Features
- Reflection
- Contributors
- Project Specifications
Have you always wanted to play tic tac toe with your friend ON THE SAME COMPUTER?? ๐ป Well look no further because this tic tac toe game was made to be played at parties (a party of 2 is still considered a party, yes ๐).
- JavaScript
- HTML
- CSS
- Clone this repository.
cd
into the directory.- Run
open index.html
.
- Simply play here.
- Player can only place a token in an empty space
- Players take turns after each token placement
- Player can only win by connecting 3 tokens horizontally, vertically or diagonally
- Banner indicates player turn and game outcome (win or draw)
- When a game ends, a new game restarts after 3 seconds
- Score is maintained after end of each game
- Player who did not start the current game gets to start the next game
- Player can choose their token from a list of tokens
- When a win occurs, a straight line is shown on the winning sequence
- When a win occurs, confetti rains on the entire column of the winning player
- This hardest part about this project was creating a win function to work in the console.
- My initial plan was to have an array for the player which compares their choices to the winning combinations array. In order to make both players be able to do this, I created an array with two player instances inside. Unfortunately, the only way to make the win function work was to have 3 for loops which were nested which took me 9 hours to do (this was explicitly stated to not implement in the rubric).
- My second attempt was to hard code all the winning positions into the function instead of referring to it in the constructor of the Game instance. This method kind of worked but I had to adjust it. Unfortunately, I still had two separate winning functions and needed to refactor. The refactoring took some time to figure out but made the code very simple!
- Project specs can be found here.