I made a simple console game Tic Tac Toe using C++. I made it to be
played by two humans using the keyboard. I want to make this game to be
played by one human against computer’s artificial intelligence. I need
some help, some ideas. I will post my game tomorrow.
Please, give me some ideas.
Sorry for my english.
Please log in or register to post a reply.
This is probably the most trivial problem in AI. Its easy to work out
the correct move if you just implement the rules
To give the AI a difficulty use a random move and the smarter the AI,
the less it makes random moves
Thank you for the link. I will read all that informations about tic tac
toe strategy. Implementing rules for AI is pretty hard for me now, but i
will learn how to do that.
I want to post my game, but how?
Should I upload it on a server?
When making a tic-tac-like game, the AI should work like this:
If you want to learn more about this kind of reasoning in-depth, take a
look at the Minimax decision-making strategy at
is the way to really speed up the Minimax algorithm.
the whole game is so simple you could record every single counter
move for every square manually in a lookuptable.
u can do chess like this, but without as much success because there
is too many permutations.
Just a small tip: It’s also fun to have a tic-tac-toe game, where the
player will have to try to loose instead of win. I remember having a big
time in an adventure game (don’t remember it’s name right now…) where
a quest involved letting the opponent win in a tic-tac-toe game.
Unfortunatelly, that opponent was doing everything so blatamly wrong
that it was actually quite tricky to do.
i’ve implemented a tic tac toe game with a trainable neural network to
play against and train. It took a while, but eventually it learned how
to play as good as a human being, and even better.
I’m not really sure why anyone would implement a tic-tac-toe game with
NNs. The game can easily be solved exactly using minimax search with
alpha-beta pruning on modern machines. The strategy for this game is so
simple that even humans can easily work out the optimal strategy with a
little thought. Surely if one is trying to learn how to use NNs for game
AI, there are better examples of applications?
I knot NN’s are the way to go in Tic Tac Toe, but i was learning about
the theory behind NN and Tic Tac Toe was fairly easy and fast to
implement, and ever better, the network was easy and fast to train, so
it didn’t take long to see if my code actually worked as it should.