Karel R Tuesday Table of Contents

Preface

CONTENTS

1 The Robot World

1.1 The Robot World
1.2 Robot Capabilities
1.3 Tasks and Situations
1.4 Robots and Objects
1.5 Important Ideas From This Chapter
1.6 Problem Set
2 Primitive Instructions and Simple Programs
2.1 Changing Position
2.2 Turning in Place
2.3 Finishing a Task
2.4 Handling Beepers
2.5 Robot Descriptions
2.6 A Complete Program
2.7 Error Shutoffs
2.8 Programming Errors
2.9 A Task for Two Robots
2.10 Separating Out the Task
2.11 An INFINITY of Beepers
2.12 Some Terminology
2.13 Important Ideas From This Chapter
2.14 Problem Set
3 Extending the Robot Programming Language
3.1 Creating a More Natural Programming Language
3.2 A Mechanism that Defines New Classes of Robots
3.3 Defining the New Methods
3.4 The Meaning and Correctness of New Methods
3.5 Defining New Methods in a Program
3.6 Modifying Inherited Methods
3.7 An Ungrammatical Program
3.8 Tools for Designing and Writing Robot Programs
3.9 Advantages of Using New Instructions
3.10 Mixins with Modules
3.11 Writing Understandable Programs
3.12 Important Ideas From This Chapter
3.13 Problem Set
4 Polymorphism
4.1 Robot Teams
4.2 Similar Tasks
4.3 Object Oriented Design -- Clients and Servers
4.4 Choreographers
4.5 Using Polymorphism
4.6 Still More on Polymorphism -- Strategy and Delegation
4.7 Ruby Array and More on Strategies
4.8 Decorators
4.9 Observers
4.10 Final Words on Polymorphism
4.11 Important Ideas From This Chapter
4.12 Problem Set
5 Conditionally Executing Instructions
5.1 The IF Instruction
5.2 The Conditions That Robots Can Test
5.3 Simple Examples of the IF Instruction
5.4 The IF/ELSE Instruction
5.5 Nested IF Instructions
5.6 More Complex Tests
5.7 The IF/ELSIF and IF/ELSIF/ELSE Instructions
5.8 When to Use an IF Instruction
5.9 Transformations for Simplifying IF Instructions
5.10 Polymorphism Revisited (Advanced Topic)
5.11 Important Ideas From This Chapter
5.12 Problem Set
6 Instructions That Repeat
6.1 The FOR-LOOP Instruction
6.2 Iterators
6.3 The WHILE Instruction
6.4 Errors to Avoid with WHILE Loops
6.5 Nested WHILE Loops
6.6 WHILE and IF Instructions
6.7 Reasoning about Loops
6.8 A Large Program Written by Stepwise Refinement
6.9 When to Use a Repeating Instruction
6.10 Important Ideas From This Chapter
6.11 Problem Set
7 Advanced Techniques for Robots
7.1 Introduction to Recursion
7.2 More on Recursion
7.3 Tail Recursion and Looping
7.4 Going Formal
7.5 Searching
7.6 Doing Arithmetic
7.7 Polymorphism--Why Write Many Programs When One Will Do?
7.8 Dynamic Ruby
7.9 Conclusion
7.10 Important Ideas From This Chapter
7.11 Problem Set
8 Concurrent Robot Programs
8.1 Simple Concurrent Programs
8.2 Robot Runs In Its Own Thread
8.3 Cooperation
8.4 Race Conditions
8.5 Deadlock
8.6 Important Ideas From This Chapter
8.7 Problem Set
Appendix
1 Ruby Code – run or import
2 Executing Robot Code in Ruby
3 Typical Imports
4 Constructors in Ruby
5 Ruby Visibility
6 Ruby Cloning
7 Open Closed Principle
8 Karel's World (RobotWorld) and Testing
9 Common Ruby Errors
10 Ruby Tools
Index