יום שני, 14 בפברואר 2011

Gridworld: Part1: Exercises page 8



1. Test the setDirection()   method with the following inputs and complete the table, giving the compass direction each input represents.



degrees
compass direction
0
North
45
North East
90
East
135
South East
180
South
225
South West
270
West
315
North West
360
West

2. Move a bug to a different location using themoveTo()   method.

In which directions can you move it?

How far can you move it?

What happens if you try to move the bug outside the grid?
You can move it anywhere on the grid, or you'll get an error message, you have to supply it with the column and row.
3. Change the color of a bug, a flower, and a rock.

Which method did you use?
setColor()
4. Move a rock on top of a bug and then move the rock again.

What happened to the bug?
The bug became invisible, or it disappeared.


אין תגובות:

הוסף רשומת תגובה