Download Instructor`s Guide - Seidenberg School of Computer Science and

Transcript
complex.
We recommend that you give students a complete, correct, robot program that they can
play with. After they get it running, they should try to make a single error (say a lexical
error) and then try to compile and run, just to see what happens. Then they won't be
surprised when it happens to them. Then try a syntactical error, etc.
2.8.1 Bugs and Debugging
This presents the idea of bugs. We prefer to call them errors and would like to create the
term deerroring but this sounds like another animal (deerroring). There are some new
ideas in Chapter Three that can help students reduce the number of errors. One of these
is stressing the need to plan and analyze thoroughly before implementing (keying in the
program). Many of our students (especially the hackers) feel they think best at the
keyboard. This attitude is just plain wrong unless you use a testing framework such as
JUnit, which the Karel J Robot simulator does support. For a novice such an attitude
might be avoided if we begin stressing now the idea of, “Read in English, Think in
English, Discuss in English, Plan in English, then, and only then, Program in the robot
programming language.”
2.9 A Task for Two Robots
We just introduce the topic. Much will be made of it in Ch. 4. We show a simple main
that uses two robots.
2.10 An Infinity of Beepers
Again just an introduction for completeness. There are some interesting problems later.
Note that a robot can carry an infinity of beepers (metaphor – a beeper creation engine in
its beeper bag). We can also find such on a corner. The Directions interface gives access
to the word infinity. When creating a world with a text editor, -1 beepers indicates an
infinite number on a corner.
You need to cover the first 6 sections before assigning any of the problems here. Most of
them are then accessible.
Section
1
2
3
4
5
6
7
8
9
10
Problem map
1,3,4-10
2
11
12, 13
Page 9