
Today I created a two-player mode for my tic-tac-toe game. Instead of starting a new project, I decided to modify the tic-tac-toe game I finished yesterday. I could have created a new project, but I decided modifying the existing one would be more convenient for users. This way they didn’t have to go to two separate pages dependent on whether they wanted two players or not.
This was a pretty simple modification. I added a button to switch between modes and an if statement to check which mode the game was in. There was a slight issue with detecting a tie, but solved it with an else if, checking for a variable change without a function return. The game is still available here: https://zidri.github.io/TicTacToePage/ and the source code is available on my GitHub.
