Learn to Program with Scratch

Book description

By offering a methodical guide to all of Scratch's surprisingly powerful features, Learn to Program with Scratch gives you a firm grasp on the fundamental principles of programming in any language.

Table of contents

  1.  
    1. About the Author
    2. About the Technical Reviewer
  2. Acknowledgments
  3. Introduction
    1. Whom This Book Is For
    2. A Note to the Reader
    3. Features
    4. Organization of This Text
    5. Conventions Used
    6. Online Resources
    7. Errata and Updates
  4. 1. Getting Started
    1. What Is Scratch?
    2. Scratch Programming Environment
      1. The Stage
      2. Sprite List
      3. Blocks Tab
      4. Scripts Area
      5. Costumes Tab
      6. Sounds Tab
      7. Backdrops Tab
      8. Sprite Info
      9. Toolbar
    3. Paint Editor
      1. Setting the Center of an Image
      2. Setting Transparent Color
    4. Your First Scratch Game
      1. Step 1: Prepare the Backdrop
      2. Step 2: Add the Paddle and Ball
      3. Step 3: Start the Game and Get Your Sprites Moving
      4. Step 4: Spice It Up with Sound
    5. Scratch Blocks: An Overview
    6. Arithmetic Operators and Functions
      1. Arithmetic Operators
      2. Random Numbers
      3. Mathematical Functions
    7. Summary
    8. Problems
  5. 2. Motion and Drawing
    1. Using Motion Commands
      1. Absolute Motion
      2. Relative Motion
      3. Other Motion Commands
    2. Pen Commands and Easy Draw
    3. The Power of Repeat
      1. Rotated Squares
      2. Exploring with Stamp
    4. Scratch Projects
      1. Get the Money
      2. Catching Apples
    5. More on Cloned Sprites
    6. Summary
    7. Problems
  6. 3. Looks and Sound
    1. The Looks Palette
      1. Changing Costumes to Animate
      2. Sprites That Speak and Think
      3. Image Effects
      4. Size and Visibility
      5. Layers
    2. The Sound Palette
      1. Playing Audio Files
      2. Playing Drums and Other Sounds
      3. Composing Music
      4. Controlling Sound Volume
      5. Setting the Tempo
    3. Scratch Projects
      1. Dancing on Stage
      2. Fireworks
    4. Summary
    5. Problems
  7. 4. Procedures
    1. Message Broadcasting and Receiving
      1. Sending and Receiving Broadcasts
      2. Message Broadcasting to Coordinate Multiple Sprites
    2. Creating Large Programs in Small Steps
      1. Creating Procedures with Message Broadcasting
      2. Building Your Own Block
      3. Passing Parameters to Custom Blocks
      4. Using Nested Procedures
    3. Working with Procedures
      1. Breaking Programs Down into Procedures
      2. Building Up with Procedures
    4. Summary
      1. Problems
  8. 5. Variables
    1. Data Types in Scratch
      1. What’s in the Shape?
      2. Automatic Data Type Conversion
    2. Introduction to Variables
      1. What Is a Variable?
      2. Creating and Using Variables
      3. The Scope of Variables
      4. Changing Variables
        1. Spider Web
        2. Pinwheel
      5. Variables in Clones
    3. Displaying Variable Monitors
    4. Using Variable Monitors in Applications
      1. Simulating Ohm’s Law
      2. Demonstrating a Series Circuit
      3. Visualizing a Sphere’s Volume and Surface Area
      4. Drawing an n-Leaved Rose
      5. Modeling Sunflower Seed Distribution
    5. Getting Input from Users
      1. Reading a Number
      2. Reading Characters
      3. Performing Arithmetic Operations
    6. Summary
    7. Problems
  9. 6. Making Decisions
    1. Comparison Operators
      1. Evaluating Boolean Expressions
      2. Comparing Letters and Strings
    2. Decision Structures
      1. The if Block
      2. Using Variables as Flags
      3. The if/else Block
      4. Nested if and if/else Blocks
      5. Menu-Driven Programs
    3. Logical Operators
      1. The and Operator
      2. The or Operator
      3. The not Operator
      4. Using Logical Operators to Check Numeric Ranges
    4. Scratch Projects
      1. Guess My Coordinates
      2. Triangle Classification Game
      3. Line Follower
      4. Equation of a Line
      5. Other Applications
    5. Summary
    6. Problems
  10. 7. Repetition: A Deeper Exploration of Loops
    1. More Loop Blocks in Scratch
      1. The repeat until Block
      2. Building a forever if Block
    2. Stop Commands
      1. Ending a Computational Loop
      2. Validating User Input
    3. Counters
      1. Check a Password
      2. Counting by a Constant Amount
    4. Revisiting Nested Loops
    5. Recursion: Procedures that Call Themselves
    6. Scratch Projects
      1. Analog Clock
      2. Bird Shooter Game
      3. Free-Fall Simulation
      4. Projectile Motion Simulator
      5. Other Applications
    7. Summary
    8. Problems
  11. 8. String Processing
    1. Revisiting the String Data Type
      1. Counting Special Characters in a String
      2. Comparing String Characters
    2. String Manipulation Examples
      1. Igpay Atinlay
      2. Fix My Spelling
      3. Unscramble
    3. Scratch Projects
      1. Shoot
      2. Binary to Decimal Converter
      3. Hangman
      4. Fraction Tutor
    4. Summary
    5. Problems
  12. 9. Lists
    1. Lists in Scratch
      1. Creating Lists
      2. List Commands
        1. Add and Delete
        2. Insert and Replace
        3. Accessing List Elements
        4. The Contains Block
      3. Bounds Checking
    2. Dynamic Lists
      1. Filling Lists with User Input
      2. Creating a Bar Chart
    3. Numerical Lists
      1. Finding Min and Max
      2. Finding the Average
    4. Searching and Sorting Lists
      1. Linear Search
      2. Frequency of Occurrence
      3. Bubble Sort
      4. Finding the Median
    5. Scratch Projects
      1. The Poet
      2. Quadrilateral Classification Game
      3. Math Wizard
      4. Flower Anatomy Quiz
      5. Other Applications
    6. Summary
    7. Problems
  13. A. Sharing and Collaboration
    1. Creating a Scratch Account
    2. Using the Backpack
    3. Creating Your Own Project
      1. Starting a New Project
      2. Remixing a Project
      3. The Project Page
      4. Sharing Your Project
  14. About the Online Resources
  15. Updates
  16. Index
  17. About the Author
  18. Copyright

Product information

  • Title: Learn to Program with Scratch
  • Author(s): Majed Marji
  • Release date: February 2014
  • Publisher(s): No Starch Press
  • ISBN: 9781593275433