Source Code
Download
- hello.py (Chapter 3, Strings)
- guess.py (Chapter 4, Guess the Number)
- jokes.py (Chapter 5, Jokes)
- dragon.py (Chapter 6, Dragon Realm)
- hangman.py (Chapter 9, Hangman)
- tictactoe.py (Chapter 10, Tic Tac Toe)
- bagels.py (Chapter 11, Bagels)
- sonar.py (Chapter 13, Sonar)
- cipher.py (Chapter 14, Caesar Cipher)
- reversi.py (Chapter 15, Reversi)
- AISim1.py (Chapter 16, AI Simulation)
- AISim2.py (Chapter 16, AI Simulation)
- AISim3.py (Chapter 16, AI Simulation)
- pygameHelloWorld.py (Chapter 17, Graphics and Animation)
- animation.py (Chapter 17, Graphics and Animation)
- collisionDetection.py (Chapter 18, Collision Detection and Input)
- pygameInput.py (Chapter 18, Collision Detection and Input)
- spritesAndSounds.py [graphics files] (Chapter 19, Sound and Images)
- dodger.py [graphics files] (Chapter 20, Dodger)
Copy and Paste
If you don't want to download the files, you can select the program you want from this dropdown menu and copy & paste the source code from the text area below.
First, click inside the text field. Then press Ctrl-A to Select All, then press Ctrl-C to Copy the selected text. Then paste the text into IDLE or your text editor.
(Click on the text field, press Ctrl-A to select all, then Ctrl-C to copy.)

