Hey Guys !! I was just working on the Tic Tac Toe Problem and was trying to use the Minimax Algorithm. Though i admit that my code doesn't exactly use templates and other stuff but its simple and easy to understand. Although i don't understand the problem right now. The code isn't working properly. Can anyone suggest me any improvements ?
Okay let me explain the code a little bit. The function void MaxMove() and void MinMove() are responsible for making the moves of human and the computer respectively. The function char evaluate() is responsible for deciding the win, loss or draw during the match. The function void randomtoss() is responsible for deciding who will move first ; The player or the computer. The function char staticevaluate(char *) is the heuristic i have used but i think this function has some fault.....I'm not exactly sure.....and finally the function void process() makes the problem run.
I have used the variable arr[9] to store the single dimensional array. The variable VALUE is the heuristic value of the program.
I think the main problem is in the heuristic function and the MinMove() function. Can you please suggest anything now ? Thanks for your previous reply. :)