Sign in to follow this  
musafir2007

Figure out AI for 9 board tic tac toe?

Recommended Posts

When I made my 3x3 Tic Tac Toe game, I first simply looped through all positions to see if the computer could win that round, If I couldn't I, then looped through to check if the player could win the next round, and if the AI still didn't have a position to place its piece, I would simply select the first available place from an array of places that went from the best positions (middle, middle right/left etc).

You could try that or , for an extra challenge you could make it loop through the options twice or three times so the computer can plan ahead.

Hope that helped with some of the planning at least. =D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this