kara |
|
void move() |
A step forward |
void turnLeft() |
90° left turn |
void turnRight() |
90° right turn |
void putLeaf() |
Lay cloverleaf down |
void removeLeaf() |
Pick cloverleaf up |
boolean treeFront() |
Kara in front of a tree? |
boolean treeLeft() |
Is there a tree to Kara`s left? |
boolean treeRight() |
Is there a tree to Kara's right? |
boolean onLeaf() |
Is Kara on top of a cloverleaf? |
boolean mushroomFront() |
Is Kara in front of a mushroom? |
void setPosition (int x, int y) |
Put Kara at position (x,y) |
java.awt.Point getPosition() |
Returns the coordinates of Kara's current position |
world |
|
void clearAll() |
Remove all elements |
void setLeaf (int x, int y, boolean putLeaf) |
Lay down a leaf or pick one up |
void setTree (int x, int y, boolean putTree) |
Plant or remove tree |
void setMushroom (int x, int y, boolean putMushroom) |
Plant or remove mushroom |
void setSize (int newSizeX, int newSizeY) |
Change world size |
boolean isEmpty (int x, int y) |
Field empty? |
boolean isTree (int x, int y) |
Is there a tree on the field? |
boolean isMushroom (int x, int y) |
Is there a mushroom on the field? |
boolean isLeaf (int x, int y) |
Is there a leaf on the field? |
int getSizeX() |
Horizontal world size |
int getSizeY() |
Vertical world size |
tools |
|
void println (String string) |
Write string to standard output |
void showMessage (String message) |
Write string to a dialog window |
int random (int bound) |
Returns random number in the range [0..bound] |
void checkState() |
Checks the execution controller |
void sleep (int ms) |
Sleeps ms milliseconds |
String stringInput (String title) |
Lets the user input a string in a dialog window with a title .
Returns null if the dialog is aborted using Cancel. |
int intInput (String title) |
Lets the user input a integer number in a dialog window with a title .
Returns Integer.MIN_VALUE if the dialog is aborted using Cancel. |
double doubleInput (String title) |
Lets the user input a real number in a dialog window with a title .
Returns Double.MIN_VALUE if the dialog is aborted using Cancel. |