List of Listings

Chapter 3. Silly Sentence Generator 3000: creating interactive programs

Listing 3.1. Adding notes to your program

Listing 3.2. Gathering input from the player

Listing 3.3. Using + to join strings

Listing 3.4. Collecting multiple items from the player

Chapter 4. Norwegian Blue parrot game: adding logic to programs

Listing 4.1. Creating comments at the top of your new program

Listing 4.2. Making the title display on the screen

Listing 4.3. String literals that hold multiple lines of text

Listing 4.4. Creating an age for the parrot

Listing 4.5. Getting a guess and storing it in a variable

Listing 4.6. Adding logic to the game with an if statement

Listing 4.7. Using an if statement to check a password

Listing 4.8. Using a while loop to repeat instructions

Listing 4.9. Breaking out of a loop

Listing 4.10. Favorite colors

Chapter 5. Raspi’s Cave Adventure

Listing 5.1. Choosing the left or right cave

Listing 5.2. Improving the code for the player’s choice

Listing 5.3. Creating functions for the left cave

Listing 5.4. Using the new functions to simplify your code

Listing 5.5. Calling functions for each of the left cave choices

Chapter 6. Blinky Pi

Listing 6.1. Blinking LED program

Listing 6.2. Three blinking LEDs

Chapter 7. Light Up Guessing Game

Listing 7.1. Setting up the Pi’s GPIO pins

Listing 7.2. Functions that flash LEDs different colors

Listing 7.3. Refactoring the three flashing functions to a single function

Listing 7.4. Creating variables and displaying the game title and instructions

Listing 7.5. Guessing Game Loop

Listing 7.6. Play Again Loop

Chapter 8. DJ Raspi

Listing 8.1. Setting up GPIO pins for input

Listing 8.2. DJ Raspi title screen

Listing 8.3. DJ Raspi game loop

Listing 8.4. Functions for loading and playing sound files

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.136.170