The universe of turtles

This is an adaptation of LOGO for the Java Learning Machine.

It is directly inspired from the work of the mathematician Seymour Papert in the 60's. Inspired from the swiss psycholog Jean Piaget, he came up with a learning method called LOGO to teach programming to young childs. The world is full of turtles which leave a painting where they go and which respond to simple orders.

Functions to move the turtle

[!java]void [/!]forward([!java]double [/!]steps[!scala]:Double[/!])
[!java]void [/!]backward([!java]double [/!]steps[!scala]:Double[/!])
Moves forward or backward of the requested amount of steps.
[!java]void [/!]right([!java]double [/!]angle[!scala]:Double[/!])
[!java]void [/!]left([!java]double [/!]angle[!scala]:Double[/!])
Turns left or right of the given angle (in degrees).
[!java]double [/!]getX()[!scala]:Double[/!]
[!java]double [/!]getY()[!scala]:Double[/!]
Returns the current position of the turtle.
[!java]void [/!]setX([!java]double [/!]x[!scala]:Double[/!])
[!java]void [/!]setY([!java]double [/!]y[!scala]:Double[/!])
[!java]void [/!]setPos([!java]double [/!]x[!scala]:Double[/!], [!java]double [/!]y[!scala]:Double[/!])
Teleports the turtle to a new position (without leaving any trace).
[!java]void [/!]moveTo([!java]double [/!]x[!scala]:Double[/!], [!java]double [/!]y[!scala]:Double[/!])
Moves the turtle to a new position.
[!java]void [/!]circle([!java]double [/!]radius[!scala]:Double[/!])
Draw a circle of the specified radius centered on the turtle.
[!java]void [/!]hide()
Hides the turtle.
[!java]void [/!]show()
Shows the turtle back.
[!java]boolean [/!]isVisible()[!scala]:Boolean[/!]
Returns whether the turtle is currently visible.
[!java]void [/!]clear()
Removes any trail on the sheet.
[!java]double [/!]getHeading()[!scala]:Double[/!]
Returns the current heading of the turtle (in degrees).
[!java]void [/!]setHeading([!java]double [/!]angle[!scala]:Double[/!])
Sets a new heading to the turtle (in degrees).

Functions about the pen

[!java]void [/!]penUp()
Moves the pen up (turtles have pens, not brushes as buggles). The turtle will not leave any trace during its subsequent moves.
[!java]void [/!]penDown()
Moves the pen down. The turtle will leave a trace during its subsequent moves.
[!java]boolean [/!]isPenDown()[!scala]:Boolean[/!]
Returns the current pen position as a boolean.
[!java]Color [/!]getColor()[!scala]:Color[/!]
Returns the current pen color.
[!java]void [/!]setColor([!java]Color [/!]color[!scala]:Color[/!])
Changes the pen color.

Other functions

[!java]boolean [/!]isSelected()[!scala]:Boolean[/!]
Returns whether the current turtle is selected in the graphical interface.

Valid colors

NameColor
Color.black  
Color.blue  
Color.cyan  
Color.darkGray  
Color.gray  
Color.green  
Color.lightGray 
Color.magenta  
Color.orange  
Color.pink  
Color.red  
Color.white  
Color.yellow