This project has moved. For the latest updates, please go here.

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 <Number> Draws a line <Number> pixels in current direction
BACK Draws a line <Number> pixels in opposite direction
LEFT <Number> Turns direction <Number> degrees left
RIGHT<Number> Turns direction <Number> degrees right
REPEAT <Number> [ <Commands> ] Repeats <Number> times the commands enclosed in [ ]
MOVETO <Number> , <Number> 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 <Routine name>
<Commands>
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.

Last edited Feb 1, 2013 at 7:49 PM by mhoff, version 37

Comments

No comments yet.