How the Game works?
GAME AI:
- First, see if there’s a move the computer can make that will win the game. If there is, take that move. Otherwise, go to step 2.
- See if there’s a move the player can make that will cause the computer to lose the game. If there is, move there to block the player. Otherwise, go to step 3.
- Check if any of the corner spaces (spaces 1, 3, 7, or 9) are free. If so, move there. If no corner piece is free, then go to step 4.
- Check if the center is free. If so, move there. If it isn’t, then go to step 5.
- Move on any of the side pieces (spaces 2, 4, 6, or 8). There are no more steps, because if the execution reaches step 5 the side spaces are the only spaces left.