Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more ➡
Standard view
Full view
of .
Add note
Save to My Library
Sync to mobile
Look up keyword or section
Like this

Table Of Contents

Writing Programs in IDLE's File Editor
Hello World!
How the "Hello World" Program Works
The "Guess the Number" Game
Sample Run of "Guess the Number"
Guess the Number's Source Code
The import Statement
The random.randint() Function
Passing Arguments to Functions
The Boolean Data Type
Comparison Operators
Experiment with Booleans, Comparison Operators, and Conditions
Looping with While Statements
The Player Guesses
if Statements
Leaving Loops Early with the break Statement
Check if the Player Won
Check if the Player Lost
Summary: What Exactly is Programming?
A Web Page for Program Tracing
Make the Most of print()
Sample Run of Jokes
Joke's Source Code
Escape Characters
Quotes and Double Quotes
The end Keyword Argument
Introducing Functions
How to Play "Dragon Realm"
Dragon Realm's Source Code
def Statements
Boolean Operators
Return Values
Variable Scope
Where to Put Function Definitions
Displaying the Game Results
The Colon :
Where the Program Really Begins
Designing the Program
How to Play "Hangman"
Sample Run of "Hangman"
Designing a Program with a Flowchart
Creating the Flow Chart
The Importance of Planning Out the Game
Hangman's Source Code
Multi-line Strings
Constant Variables
Changing the Values of List Items with Index Assignment
List Concatenation
The in Operator
Removing Items from Lists with del Statements
Lists of Lists
The Difference Between Methods and Functions
The range() and list() Functions
for Loops
elif ("Else If") Statements
Review of the Functions We Defined
The Main Code for Hangman
Making New Changes to the Hangman Program
Sets of Words for Hangman
Multiple Assignment
Sample Run of Tic Tac Toe
Source Code of Tic Tac Toe
Game AI
List References
Short-Circuit Evaluation
The None Value
Augmented Assignment Operators
The sort() List Method
The join() String Method
String Interpolation
Summary: Getting Good at Bagels
Grids and Cartesian Coordinates
Negative Numbers
Changing the Signs
Absolute Values and the abs() Function
Coordinate System of a Computer Monitor
Summary: Using this Math in Games
Sonar's Source Code
The remove() List Method
Summary: Review of our Sonar Game
The Caesar Cipher
ASCII, and Using Numbers for Letters
The chr() and ord() Functions
Sample Run of Caesar Cipher
Caesar Cipher's Source Code
The isalpha() String Method
The isupper() and islower() String Methods
Brute Force
Summary: Reviewing Our Caesar Cipher Program
How to Play Reversi
Sample Run
Reversi's Source Code
The bool() Function
Summary: Reviewing the Reversi Game
"Computer vs. Computer" Games
Division Evaluates to Floating Point
The round() Function
Displaying the Statistics
Comparing Different AI Algorithms
Learning New Things by Running Simulation Experiments
Installing Pygame
Hello World in Pygame
Hello World's Source Code
The pygame.init() Function
Variables Store References to Objects
Colors in Pygame
Fonts, and the pygame.font.SysFont() Function
The render() Method for Font Objects
The get_rect() Methods for pygame.font.Font and pygame.Surface Objects
Constructor Functions and the type() function
The fill() Method for Surface Objects
The pygame.draw.polygon() Function
The pygame.draw.line() Function
The pygame.draw.circle() Function
The pygame.draw.ellipse() Function
The pygame.draw.rect() Function
The pygame.PixelArray Data Type
The blit() Method for Surface Objects
The pygame.display.update() Function
Events and the Game Loop
The pygame.event.get() Function
The pygame.quit() Function
The Animation Program's Source Code
Some Small Modifications
Summary: Pygame Programming
The Collision Detection Program's Source Code
The colliderect() Method
Summary: Collision Detection and Pygame Input
Image and Sound Files
Sprites and Sounds Program
The Sprites and Sounds Program's Source Code
Setting Up the Window and the Data Structure
The pygame.transform.scale() Function
Implementing the Cheat Codes
Modifying the Dodger Game
Summary: Creating Your Own Games
0 of .
Results for:
No results containing your search query
P. 1


Ratings: (0)|Views: 5,424|Likes:
Published by mikeannike

More info:

Published by: mikeannike on Sep 12, 2010
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See More
See less





You're Reading a Free Preview
Pages 8 to 163 are not shown in this preview.
You're Reading a Free Preview
Pages 171 to 250 are not shown in this preview.
You're Reading a Free Preview
Pages 258 to 312 are not shown in this preview.
You're Reading a Free Preview
Pages 320 to 333 are not shown in this preview.
You're Reading a Free Preview
Pages 341 to 394 are not shown in this preview.

Activity (13)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads
gonzalej liked this
gonzalej liked this
collagen1 liked this
DirkVoss liked this
tafe4cs liked this
dave_765 liked this
reader27 liked this

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->