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

Gridworld: Part 3: Classes & Interfaces: Set 6: Page 25-26



1
Which statement(s) in the canMove() method ensures that a bug does not try to move out of its grid?  

2
Which statement(s) in the canMove()method determines that a bug will not walk into a rock?  

3
Which methods of the Grid  interface are invoked by the canMove()  method and why?  

4
Which method of the Location  class is invoked by the canMove() method and why?  

5
Which methods inherited from the Actor class are invoked in the canMove()method?  

6
What happens in the move() method when the location immediately in front of the bug is out of the grid?  

7
Is the variable loc needed in the move()method, or could it be avoided by callinggetLocation() multiple times?  

8
Why do you think the flowers that are dropped by a bug have the same color as the bug?  

9
When a bug removes itself from the grid, will it place a flower into its previous location?  

10
Which statement(s) in the  move() method places the flower into the grid at the bug’s previous location?  

11
If a bug needs to turn 180 degrees, how many times should it call the turn()method?  

אין תגובות:

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