Skip to content
Morten Hoffmann Sørensen edited this page Apr 20, 2017 · 2 revisions

Compile

Project comes complete with needed NuGet packages. Just download and compile (VS2010 / .NET 4.0+)

LOGO commands

Command Description
CLEAR Clears the drawing surface and positions the turtle at the canvas center
FORWARD Draws a line pixels in current direction
BACK Draws a line pixels in opposite direction
LEFT Turns direction degrees left
RIGHT Turns direction degrees right
REPEAT { } Repeats times the commands enclosed in {" "}
MOVETO , Moves turtle to given position (X,Y)
The drawing canvas has its lower left corner as (0,0). The canvas size is (500, 400).
Only positive integer numbers are allowed.

LOGO routines

TO END

To call the routine, just refer to it by name.

LOGO examples

To get started (from file \MhsLogoParser\MhsLogoTests\LogoExamples.txt)

Square: {{ REPEAT 4 FORWARD 100 LEFT 90 }}

Flower: {{ TO RECTANGLE REPEAT 4 FORWARD 100 RIGHT 90 END REPEAT 36 RECTANGLE RIGHT 10 }}

Fans: {{ REPEAT 36 [ REPEAT 4 [ RIGHT 90 FORWARD 30 RIGHT 90 FORWARD 60 RIGHT 90 FORWARD 90 ] RIGHT 15 ] }}

Please supply more examples as project grows in capability.

Clone this wiki locally