# Unit 1 – Advanced Demo: Robot

A `Robot` appears as a coloured square on a canvas window and moves 
around it one cell at a time. Its name and colour are fixed at 
creation. Its position (`x`, `y` in pixels) and step count change 
with each move.

## Setting up

1. Compile `Canvas` and `Robot`.
2. Create a robot: `Robot("R2", "blue")` — a canvas window opens 
   immediately.
3. Call `show()` — R2 appears as a coloured square on the canvas.

## Moving the robot

4. Call `moveUp()` three times — R2 moves upward on the canvas.
   Watch the terminal output showing the updated position.
5. Call `moveRight()` twice, then `describe()` — check position 
   and step count.
6. Call `teleportTo(50, 50)`, then `describe()` — position changes 
   but `totalSteps` does not increase. Teleporting is not a step.
7. Call `step(80, 0, "right fast")` directly — R2 moves 80 pixels 
   right in one call. The four direction methods are shortcuts that 
   each call `step()` with fixed values.

## What to look at in the code

8. Open `Robot`. The methods `draw()` and `erase()` are marked 
   `private`. In BlueJ's method menu for R2, confirm that they 
   do not appear.
9. Notice that `moveUp()`, `moveDown()`, `moveRight()`, and 
   `moveLeft()` each contain only one line — a call to `step()`. 

## Two robots

10. Create a second robot: `Robot("ZB", "red")`. Call `show()` on ZB.
11. Move both robots independently — confirm R2's position and step 
    count are unaffected by ZB's movements.
