So I’ve been in the process of getting started with writing the tic-tac-toe game. I have a good UI, I have a process that checks who wins (user or computer) I’m just not sure how to get the computer moves started - I’ve read about the minimax algo though I’m not understanding it and am unsure what the best way to implement a computer move would be. Does anyone have ideas on getting started? Is someone willing to pair code with me?
Code on GitHub: https://github.com/nsuchy/freecodecamp-build-a-tic-tac-toe-game
Some Notes on my code:
The current code is mostly checking against the text content of each button that has a unique, if needed the code can be include some sort of array of input for easy iteration to decide a move. On each button click, the button’s text is updated - checked for a win - then the computer will move - and again check for a win. I’ve included these notes to help whoever wants to help further understand what my code is trying to do.