I followed this tutorial: https://www.youtube.com/watch?v=trKjYdBASyQ even if it isn't in C++ I was able to recreate everything. Tho when I run my program the Ai just goes from the first available till the end so and so forth. TL:DR: It doesn't really think its moves. This is my AI Code:
https://pastebin.com/0uPHMCni
Also, the variables are declared good (I checked) The only problem is the way the AI thinks which I checked its code like 700 times so far yet I don't see nothing wrong from the tutorial.
In this challenge I take the Tic Tac Toe game from coding challenge #149 and add an AI opponent for a human player by implenenting the Minimax algorithm. Code: https://thecodingtrain.com/challenges/154-tic-tac-toe-minimax
🕹️ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/0zyUhZdJD
🎥 Previous video: https://youtu.be/ZCXkv...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.