December 2022
Beginner
384 pages
10h 44m
English
At the climax of the 1983 film WarGames, the computer that’s about to start World War III is directed to play a game of tic-tac-toe with itself. Recognizing that the game is silly because experienced players often end play in a draw, the computer determines that nuclear war is futile. It decides not to blow up the world. This conclusion should add some excitement to this chapter, because you can equate any game of tic-tac-toe—even one simulated on a computer—to nuclear war.
Game play for tic-tac-toe is simple. It’s easy to code. If you haven’t yet done so, now is the time to write your own version of the game. Of course, it’s made more complex when you consider such tasks as:
Coding a game loop
Programming turns for players ...