## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

No credit card required

## Book Description

A fun introduction to programming with Small Basic for kids and other beginners.

1. Cover Page
2. Title Page
5. Brief Contents
6. Contents in Detail
7. Foreword
8. Acknowledgments
9. Introduction
10. Chapter 1: Introducing Small Basic
1. What Is a Computer?
2. What Is a Computer Program?
3. What Is Small Basic?
4. The Vision of Small Basic
5. The Basics of Small Basic
6. Installing Small Basic
7. The Small Basic IDE
8. Writing and Running Your First Program
9. Drawing with Small Basic
10. Programming Challenges
11. Chapter 2: Getting Started
1. The Parts of a Program
2. Characters and Strings
3. Arguments and Methods
2. Exploring Other Features
1. Case Sensitivity
2. Sequential Execution
3. Displaying Numbers and Doing Math
4. Joining Strings
3. Object Properties
1. Setting and Changing Property Values
2. Working with Properties
4. Arithmetic Operators
5. Programming Errors
6. Programming Challenges
12. Chapter 3: Drawing Basics
1. The Graphics Coordinate System
2. Drawing Lines
3. Drawing Shapes
1. Triangles
2. Rectangles and Squares
3. Ellipses and Circles
4. Pen Size and Color
5. Pen Width and Shape Size
4. Drawing Text
5. Inserting Images
6. Programming Challenges
13. Chapter 4: Using Variables
1. What’s a Variable?
2. The Basics of Using Variables
1. Assigning Expressions to Variables
2. Passing Variables to Methods
3. Changing the Value of a Variable
3. Rules for Naming Variables
1. Say What You Mean
2. Find the Right Length
4. Let IntelliSense Work for You
5. Avoid Naming Variables After Methods and Objects
4. Simplifying Expressions
5. Using Variables to Solve Problems
6. Two Kinds of Data
7. Global Variables
8. Programming Challenges
14. Chapter 5: Drawing Shapes with Turtle Graphics
1. Meet the Turtle
2. Moving the Turtle
1. Absolute Motion
2. Relative Motion
3. Introducing the For Loop
4. Drawing Regular Polygons
1. A Star Is Born
2. Creating Polygon Art Using Nested Loops
3. Endless Graphics
5. Programming Challenges
15. Chapter 6: Getting User Input
1. Talking to the Computer
2. Working with User Input
1. Converting Fahrenheit to Celsius
2. Averaging Numbers
3. Programming Challenges
16. Chapter 7: Empowering Programs with Math
1. Exponent Methods
1. SquareRoot() and Good Old Pythagoras
2. Powerful Powers
2. Rounding Methods
2. Rounding to the Nearest Hundredth
3. Abs(), Min(), and Max() Methods
4. The Remainder() Method
5. Random Numbers
6. Trigonometric Methods
7. Programming Challenges
17. Chapter 8: Making Decisions with If Statements
1. The If Statement
1. Relational Operators
2. Complex If Conditions
3. Comparing Strings
2. The If/Else Statement
3. Nested If and If/Else Statements
4. The Goto Statement
5. Programming Challenges
18. Chapter 9: Using Decisions to Make Games
2. The Bug on the Ladder
2. Let’s Get Logical
1. Logical Operators in the Zoo
2. The And Operator
3. The Or Operator
4. The Cosmic Order of Evaluation
3. The Shapes Object
4. Create a Game: Guess My Coordinates
1. Step 1: Open the Startup File
2. Step 2: Set Up the Game
3. Step 3: Hide the Star
4. Step 4: Let the User Guess
5. Programming Challenges
19. Chapter 10: Solving Problems with Subroutines
1. Why Use Subroutines?
2. Writing Subroutines
3. Subroutine Input and Output
4. Nesting Subroutines
5. Create a Dragon Game
6. Programming Challenges
20. Chapter 11: Event-Driven Programming
1. GraphicsWindow Events
1. Create Patterns with the MouseDown Event
2. Fire Missiles with the KeyDown Event
3. Make a Typewriter Using the TextInput Event
4. Draw Pictures with the MouseMove Event
2. Useful Tips
3. Create a Gold Rush Game
1. Step 1: Open the Startup File
2. Step 2: Move the Turtle
3. Step 3: Move the Bag of Gold
4. Step 4: Update the User’s Score
4. Programming Challenges
21. Chapter 12: Building Graphical User Interfaces
1. Design a User Interface with the Controls Object
1. Step 1: The Design Phase
2. Step 2: Program Interactivity
2. Make a Colorful Drawing Program
3. Explore Circuits with Code
1. Step 1: Open the Startup File
2. Step 2: Add the Main Code
3. Step 3: Toggle the Switch
4. Step 4: Respond to Changes
5. Step 5: Update the Program’s Interface
4. Program Your Own Image Viewer
5. Programming Challenges
22. Chapter 13: Repeating For Loops
1. The For Loop
1. Try It Out 13-1
2. Magical Moving Text
5. Drawing All Kinds of Lines
2. Changing the Step Size
1. Counting Down by Twos
2. Making a Fractional Step
3. Nested Loops
1. Tessellating for Fun
2. Multiple Nesting Levels
4. Programming Challenges
23. Chapter 14: Creating Conditional While Loops
1. When to Use While Loops
2. Writing a While Loop
4. Infinite Loops
5. Create a Rock-Paper-Scissors Game
1. Step 1: Open the Startup File
2. Step 2: Add the MouseDown Handler
3. Step 3: Switch the Images
4. Step 4: Announce the Winner
6. Programming Challenges
24. Chapter 15: Grouping Data in One-Dimensional Arrays
1. Getting Started with Indexed Arrays
2. Array Basics
3. Initializing Arrays
4. Filling Arrays with a For Loop
1. Constant Initialization
2. Random Initialization
3. Formula Initialization
4. User Initialization
5. Displaying Arrays
6. Processing Arrays
7. Using String Values in Arrays
8. Saving Records
9. Using Indexed Arrays
1. Random Selection
2. A Magic 8 Ball
10. Create the Catch Apples Game
1. Step 1: Open the Startup File
2. Step 2: Add the Apples
3. Step 3: Position the Apples
4. Step 4: Move the Apples
5. Step 5: Catch or Miss
11. Programming Challenges
25. Chapter 16: Storing Data with Associative Arrays
1. Associative Arrays
2. Putting Associative Arrays to Use
1. Days in French
2. Storing Records
3. The Array Object
1. Is It an Array?
2. How Big Is an Array?
3. Does It Have a Particular Index?
4. Does It Have a Particular Value?
5. Give Me All the Indices
5. Programming Challenges
26. Chapter 17: Expanding to Higher-Dimension Arrays
1. Two-Dimensional Arrays
1. A Random Matrix
2. A Matrix with User Input
3. Animated Squares
4. Using String Indices
5. Going Interactive
2. Common Operations on Numerical 2D Arrays
1. Step 1: Add All Elements
2. Step 2: Find the Sum of Each Column
3. Arrays of Three or More Dimensions
4. Create a Treasure Map Game
5. Programming Challenges
27. Chapter 18: Advanced Text Magic
1. The Text Object
1. Appending Strings and Getting Their Length
2. Taking Strings Apart: Substrings
3. Changing Case
4. Character Coding with Unicode
2. Practical Examples with Strings
1. Counting Special Characters
2. Palindrome Number Checker
3. Igpay Atinlay
4. Fix My Spelling
5. Unscramble
3. Rhyme Time: The House That Jack Built
4. Programming Challenges
28. Chapter 19: Receiving File Input and Output
1. The Case for Files
2. The File Object
1. File I/O Methods
2. File Management
3. Practical Programs
1. The Poet
2. Math Wizard
4. Programming Challenges
29. Where to Go from Here
30. Index