Jump to content
  • Advertisement
Sign in to follow this  
Carolina

A way to make a better tic tac toe game

This topic is 4724 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everybody! Well,I´m currently programming a Tic Tac Toe game,but the question is:how do I make the computer learn better movements and be,you know,more human-like when playing?I´ve heard about an algorithm named Minimax that can be used for this.Does anyone know a good source of information about Minimax or other similar learning algorithms? Thanks in advance, Carol

Share this post


Link to post
Share on other sites
Advertisement
Actually, Minimax is used for evaluating next move for computer, not for learning. It's more or less just brute force - checks all states recursively, up to some point.

If you want to have computer learn sth, neural nets may help you, though, (IMHO) using them properly can be hard...

You could also do sth trivial, like record all states from previous games, see if current game state matches any of them, if it does - see whether that game was won or lost by computer. If it was won, then use move from that game, otherwise - proceed to next :-)

Very trivial and stupid, but at least - easy to implement and can be improved significantly.

Share this post


Link to post
Share on other sites
See if this gives you any useful ideas. :) (You can generate the "matchboxes" on the fly, storing options for example in a std::map<BoardPosition, OptionList>; if at any time a BoardPosition is encountered that's not referenced in the map, generate an OptionList consisting of all empty squares, insert that, and continue as normal.)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!