Python Programming for the Absolute Beginner, 3rd Edition

In this chapter project, you'll learn how to create a computer opponent using a dash of artificial intelligence (AI). In the game, the player and computer square off in a high-stakes, human-machine showdown of Tic-Tac-Toe. The computer plays a formidable, though not perfect, game, and comes with enough attitude to make any match fun. Figures 6.1 through 6.3 illustrate the gameplay.

Figure 6.1: The computer is full of ... confidence.

Figure 6.2: I did not see that coming. Even with simple programming techniques, the computer makes some pretty good moves.

Figure 6.3: I found the computer's weakness and won this time.

Категории