I feel pretty stupid. I’ve made my way through all the front end projects but this one has me stuck on what feels like it should be an easy step. I can’t figure out how to implement the turns in the game. I can swap from player’s turn to computer’s turn easily enough within a while loop, but I’m unable to make the game wait for the user’s input.
I’ve abandoned the rest of the gameplay for now and just made a really basic test game in which the user and computer add Xs and Os to the screen in turn, just to work out what I’m doing wrong. I’ve tried searching everything I can on turn based games and user input. As I’m using Jquery it seems the .on() method should work but in practice I seem to be doing it wrong and keep getting stuck in infinite loops.
Please can anyone help? I feel so stupid.