I have created a Tic Tac Toe game (Noughts and Crosses in the UK!) and have finished almost everything except perhaps improving the computer AI (its just random at the moment). However, there is one bug that I can't seem to fix. When you first play the game you get the choice of playing against another human (player 2) or computer. Once this "human" or "computer" button is pressed it will save the information in a variable "let choiceComp" as either "human" or "comp". This will then call their respective functions, computerGame() or humanGame(), once the player enters their details and the subsequent start button is pressed. This works fine the first time around but when the reset button is pressed and the alternative game mode is selected (e.g. human first, then computer second - or vice versa), the same game mode will continue as the first time. I've reset the choiceComp variable as an empty string, along with everything els
A site where you can share knowledge