Introducing the Tic-Tac-Toe Game


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.

click to expand
Figure 6.1: The computer is full of ... confidence.

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

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




Python Programming for the Absolute Beginner
Python Programming for the Absolute Beginner, 3rd Edition
ISBN: 1435455002
EAN: 2147483647
Year: 2003
Pages: 194

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net