+ 9
Could you help me implement AI on my tic tac toe game
I've created a very simple tic tac toe works perfectly for 2p in C++, I was wondering if someone could help me implement it with the minimax algorithm. I'd really like you to recommend a c++ totutial on AI. Tic Tac Toe Code: https://code.sololearn.com/ckyl0hVh73TV/#cpp
13 Respostas
+ 4
Prometheus 🇸🇬 I am pretty sure that I could start as well and not have the ai start because if I would of start then it wouldn't work
+ 3
https://code.sololearn.com/WejZMx2Qg3GR/?ref=app
Check this impossible-to-win AI I made
+ 3
Prometheus 🇸🇬 don't get me wrong I appreciate the fact that you are trying to help me but it doesn't really work
+ 2
Prometheus 🇸🇬 I am using C++ and I am pretty sure you are not using it you are just doing all the possibilities the computer has to start
+ 2
You can use this AI structure: 1. If there is a chance to win, use it. 2. If you can prevent your enemy from winning, do that. 3. If you can make a cross in the middle do it, if not, take a cross in the corners and if these are full too, use the sides. Now have fun coding!
+ 2
You have to implement it in a c++ program that’s the challenge. Read the lines. Convert them into a function, this is a structure.
+ 2
Oh, ok 😅. I thought you needed to have a plan.
+ 1
You check the algo
+ 1
That's like half of the work done. The other half is left for you. For that you need to do what I did: Consider all possible games.
0
Prometheus 🇸🇬 Yeah this is what I was talking about I don't think that it should work like that is it really the minimax algorithm? And it's really not half of the work it's not the same style of code or not even the language
0
T. Feix What algorithm are you talking about because it's easier said than done
0
T. Feix Dude I know my options the problem is how do it do it that's why I need the algorithm
- 8
هيلاوو