Non-AI Technique The magic square grid is as follows: 8 1 6 3 5 7 4 9 2 A player (computer or user) wins if the sum of the numbers in any row or column or diagonal is equal to 15 Algorithm:
- Win Check: Check if computer can win using the concept of Magic Square
- Block Opponent: Check if opponent can win, if yes block
- Centre Move: If the centre is available take the place
- Corner Move: Take any corner available
- Edge Move: Take the remaining edges
1->represents X 2->represents 0