To create Jeroos:
Action Methods
The seven action methods control the movements of the Jeroos and their handling of the flowers.
Action |
Result |
Hop() |
Move forward one space |
Hop(n) where n is an integer > 0 |
Move forward n spaces |
Pick() |
Pick a flower from the current location |
Plant() |
Plant a flower at the current location |
Toss() |
Toss a flower one space ahead |
Give( relative_direction) |
Give a flower to a Jeroo in an adjacent space |
Turn( relative_direction ) |
Turn in the indicated direction, but stay in the same location. |
Every Jeroo program must have exactly one main method.
Sub main() '-- declare and instantiate all Jeroos '-- use the Jeroos to solve the problem End Sub |
Boolean Methods
Action |
Result |
HasFlower() |
Does this Jeroo have any flowers in its pouch? |
IsFacing( compass_direction ) |
Is the Jeroo facing the indicated direction? |
IsFlower ( relative_direction ) |
Is there a flower in the indicated direction? |
IsJeroo( relative_direction ) |
Is there a Jeroo in the indicated direction? |
IsNet( relative_direction ) |
Toss a flower one space ahead |
IsWater( relative_direction ) |
Give a flower to a Jeroo in an adjacent space |
IsClear( relative_direction ) |
Are there no obstacles (a net, a flower, a Jeroo, or water) in the indicated direction? |
These can be combined using AND, OR and NOT
Directions
Relative |
Compass |
|||
Left |
90 ° to the left of the Jeroo's current direction. |
North |
Up |
|
Right |
90 ° to the right of the Jeroo's current direction. |
East |
To the Right |
|
Ahead |
Directly in front of the Jeroo |
South |
Down |
|
Here |
Current Location |
West |
To the Left |
User-Defined Jeroo Methods
A Jeroo program can have any number of user-defined Jeroo methods.
Sub identifier () '-- body of the method End Sub |