Moving (See also the note on exceptions, below) | |
Turn left Turn right Turn back Moving forward Moving back |
[!java]void [/!]left() [!java]void [/!]right() [!java]void [/!]back() [!java]void [/!]forward() or [!java]void [/!]forward([!java]int [/!]steps[!scala]:Int[/!]) [!java]void [/!]backward() or [!java]void [/!]backward([!java]int [/!]steps[!scala]:Int[/!]) |
Get X coordinate Get Y coordinate Set X coordinate Set Y coordinate Set position |
[!java]int [/!]getX()[!scala]:Int[/!] [!java]int [/!]getY()[!scala]:Int[/!] [!java]void [/!]setX([!java]int [/!]x[!scala]:Int[/!]) [!java]void [/!]setY([!java]int [/!]y[!scala]:Int[/!]) [!java]void [/!]setPos([!java]int [/!]x[!scala]:Int[/!], [!java]int [/!]y[!scala]:Int[/!]) |
Information on the buggle | |
Get the color Set the color |
[!java]Color [/!]getColor()[!scala]:Color[/!] [!java]void [/!]setColor([!java]Color [/!]c[!scala]:Color[/!]) |
Look for a wall forward Look for a wall backward |
[!java]boolean [/!]isFacingWall()[!scala]:Boolean[/!] [!java]boolean [/!]isBackingWall()[!scala]:Boolean[/!] |
Get heading Set heading valid directions are: |
[!java]Direction [/!]getDirection()[!scala]:Direction[/!] [!java]void [/!]setDirection([!java]Direction [/!]dir[!scala]:Direction[/!]) Direction.NORTH, Direction.EAST, Direction.SOUTH and Direction.WEST |
Check whether the buggle is currently selected in the interface | [!java]boolean [/!]isSelected()[!scala]:Boolean[/!] |
About the brush | |
Brush down Brush up Get brush position |
[!java]void [/!]brushUp() [!java]void [/!]brushDown() [!java]boolean [/!]isBrushDown()[!scala]:Boolean[/!] |
Change the brush color Get the color of the brush |
[!java]void [/!]setBrushColor([!java]Color [/!]c[!scala]:Color[/!]) [!java]Color [/!]getBrushColor()[!scala]:Color[/!] |
Interacting with the world | |
Get the color of the ground | [!java]Color [/!]getGroundColor()[!scala]:Color[/!] |
Look for a baggle on the ground Look for a baggle in bag Pickup a baggle Drop a baggle (see the note on exceptions) |
[!java]boolean [/!]isOverBaggle()[!scala]:Boolean[/!] [!java]boolean [/!]isCarryingBaggle()[!scala]:Boolean[/!] [!java]void [/!]pickupBaggle() [!java]void [/!]dropBaggle() |
Look for a message Add a message Read the message Erase the message |
[!java]boolean [/!]isOverMessage()[!scala]:Boolean[/!] [!java]void [/!]writeMessage([!java]String [/!]msg[!scala]:String[/!]) [!java]String [/!]readMessage()[!scala]:String[/!] [!java]void [/!]clearMessage() |
SimpleBuggles (ie, the one used in first exercises) display an error message on problem so that you don't need to know what an exception is.