i'm writing a tictactoe program but its not your traditional tictactoe
First of all the board is 4x4 and the way to win is to get 3 of a kind and 1 of your opponents in a row, column, or diagonal. So the following would be a win for "O" via first column:
O|_|X|_
O|X|_|_
O| |_|_
X|_|_|_
I'm trying to implement a minimax algorithm in order to give the program a "hard" mode that can't be beaten.
My problem is that i cannot hope to create a tree with all the possible game states, and therefore i have to come up with some kind of function that evaluates the game states that i can generate.
I guess my question is, how can i come up with such a function?
winning strategy
(use words to describe the decision process needed to guarantee a win). – SporocystO
player could win with a row likeOOXO
, not justOOOX
orXOOO
? Also, is the use of minimax a requirement for solving the problem or would you welcome other approaches? – Ashlieashlin