Preface

Chapter 1 Introduction to Alice and Objects

Chapter 2 Programming in Alice

Chapter 3 Variables, Functions, Math, and Strings

Chapter 4 Decision Structures

Chapter 5 Repetition Structures

Chapter 6 Methods, Functions, and More about Variables

Chapter 7 Events

Chapter 8 Lists and Arrays

Chapter 9 Recursion

Appendix A Installing Alice

Index

Preface

Chapter 1 Introduction to Alice and Objects

1.1 What Is a Computer Program?

1.2 Algorithms and Programming Languages

1.3 Learning to Program with Alice

TUTORIAL 1-1: Opening and playing an Alice world

1.4 Objects

1.5 Classes and the Alice Galleries

TUTORIAL 1-2: Creating a world and adding objects

1.6 3D Objects and the Camera

TUTORIAL 1-3: Moving the camera in 3D space

TUTORIAL 1-4: Manipulating objects in 3D space

TUTORIAL 1-5: Manipulating subpart objects

Review Questions

Chapter 2 Programming in Alice

2.1 Writing Methods

TUTORIAL 2-1: Adding instructions to an Alice world

TUTORIAL 2-2: Exploring additional primitive methods

2.2 Naming Conventions

2.3 Designing a Program

TUTORIAL 2-3: Using the program design cycle

2.5 Tips for Setting Up an Initial Scene

2.6 Executing Instructions Simultaneously

TUTORIAL 2-5: Creating simultaneously executed instructions

2.7 Exporting Your Code for Printing

2.8 Exporting an Alice World to Video

Review Questions

Chapter 3 Variables, Functions, Math, and Strings

3.1 Variables

TUTORIAL 3-1: Creating and using a variable

TUTORIAL 3-2: Creating a set instruction for a variable

3.2 Using Functions

TUTORIAL 3-3: Calling an ask user function

TUTORIAL 3-4: Using a proximity function

3.3 Creating Math Expressions

TUTORIAL 3-5: Using math to avoid collisions

3.4 Working with Strings and Text

TUTORIAL 3-6: Converting a Number variable to a string

Review Questions

Chapter 4 Decision Structures

4.1 Boolean Values

4.2 The If/Else Decision Structure

TUTORIAL 4-1: Creating an If/Else instruction

TUTORIAL 4-2: Creating a Single-Alternative Decision Structure

4.3 Nested If/Else Decision Structures

TUTORIAL 4-3: Creating Nested If/Else Instructions

4.4 Relational Comparisons and Logical Operators

TUTORIAL 4-3: Using a relational operator

TUTORIAL 4-4: Testing an object’s color property

Review Questions

Chapter 5 Repetition Structures

5.1 The Loop Instruction

TUTORIAL 5-1: Using the Loop instruction

TUTORIAL 5-2: Creating a User-Controlled Loop

5.2 The While Instruction

TUTORIAL 5-3: Using a While instruction to make an object vanish

TUTORIAL 5-4: Using a While instruction to make an object smaller

TUTORIAL 5-5: Using the While instruction to move an object

5.3 Nested Loops

Review Questions

Chapter 6 Methods, Functions, and More about Variables

6.1 Writing Custom Class-Level Methods

TUTORIAL 6-1: Creating a class-level method

6.2 Saving an Object to a New Class

TUTORIAL 6-2: Saving an object to a class

6.3 Stepwise Refinement

TUTORIAL 6-3: Completing the WorkOut world

6.4 Passing Arguments

TUTORIAL 6-4: Passing arguments to a method

6.5 Using Class-Level Variables as Properties

TUTORIAL 6-5: Adding a property to an object

6.6 Writing Class-Level Functions

TUTORIAL 6-6: Writing a class-level function

TUTORIAL 6-7: Writing a class-level function

6.7 World-Level Methods and Variables

6.8 Using Clipboards

6.9 Tips for Visual Effects and Animation

Review Questions

Chapter 7 Events

7.1 Responding to Events

7.2 Handling Key Press and Mouse Events

TUTORIAL 7-1: Handling key press events

TUTORIAL 7-2: Handling the while a key is pressed event

TUTORIAL 7-3: Handling a mouse click event

7.3 Using Events in Simulations and Games

7.4 Tips for Games and Simulations

Review Questions

Chapter 8 Lists and Arrays

8.1 Lists

TUTORIAL 8-1: Creating a list and using the For all in order

and For all together instructions

TUTORIAL 8-2: More complex list processing

TUTORIAL 8-3: Using the Let the mouse move <objects> event

8.2 Arrays

TUTORIAL 8-4: Creating an array and a loop that steps through it

TUTORIAL 8-5: Randomly selecting an array element

Review Questions

Chapter 9 Recursion

9.1 Introduction to Recursion

TUTORIAL 9-1: Creating a recursive method

9.2 Problem Solving with Recursion

TUTORIAL 9-2: Recursive problem solving in animation

TUTORIAL 9-3: Writing a recursive mathematical function

Review Questions

Appendix A Installing Alice