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

Table Of Contents

Writing Programs in IDLE's File Editor
Hello World!
How the "Hello World" Program Works
Summary
The "Guess the Number" Game
Sample Run of "Guess the Number"
Guess the Number's Source Code
guess.py
The import Statement
The random.randint() Function
Passing Arguments to Functions
Blocks
The Boolean Data Type
Comparison Operators
Conditions
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
jokes.py
Escape Characters
Quotes and Double Quotes
The end Keyword Argument
Introducing Functions
How to Play "Dragon Realm"
Dragon Realm's Source Code
dragon.py
def Statements
Boolean Operators
Return Values
Variable Scope
Parameters
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"
ASCII Art
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
Lists
Changing the Values of List Items with Index Assignment
List Concatenation
The in Operator
Removing Items from Lists with del Statements
Lists of Lists
Methods
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
Dictionaries
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
bagels.py
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
sonar.py
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
cipher.py
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
reversi.py
The bool() Function
Summary: Reviewing the Reversi Game
"Computer vs. Computer" Games
AISim1.py
AISim2.py
Percentages
Division Evaluates to Floating Point
The round() Function
Displaying the Statistics
Comparing Different AI Algorithms
AISim3.py
Learning New Things by Running Simulation Experiments
Installing Pygame
Hello World in Pygame
Hello World's Source Code
pygameHelloWorld.py
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
Attributes
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
Animation
The Animation Program's Source Code
animation.py
Some Small Modifications
Summary: Pygame Programming
The Collision Detection Program's Source Code
pygameInput.py
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
spritesAndSounds.py
Setting Up the Window and the Data Structure
The pygame.transform.scale() Function
dodger.py
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
IYOCGwP_book1

IYOCGwP_book1

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

More info:

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

Availability:

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

10/31/2011

pdf

text

original

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

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