This site features a collection of common technical interview questions gathered by a group of programmers who have been through, and given, lots of technical interviews. There is an emphasis on C++ and game programming technical interviews, but most of the questions are relevant to any technical interview.
Tic Tac Toe AI

Imagine you have to write a Tic-Tac-Toe game in which a human player plays against the computer. Discuss the different ways in which you could implement the computer’s artificial intelligence for the game. Which method would you ultimately choose? And why?


3 Comments so far
Leave a comment

Minmax is the best!
http://en.wikipedia.org/wiki/Minimax

Minmax create a tree of all the possible solutions and choose the best (whixh maximise or minimise the chance of win).
Because tic tac toe has a finished number of solution is simple to create a full tree of all the possible solutions (instead of chess: it has too much solutions!)

Why build a perfect AI? you want this to be played by 8yrolds, right? Build one that makes them work!

u can instead mark the 9 blocks of the grid with numbers to create a magic square..where each row, column and diagonal sums up to 15..n maintain a track of the sum of the opponents moves..if makin a move is goin to make the some of his places to 15 then block dat move…



Leave a comment
If you are including code in your comment, place it within a <div class='code'></div> tag for better formatting.


Do you have a technical interview question you would like to submit? Some tips you would like to pass on? Just want to say hi? Feel free to contact us