lafontaine - graphical logo interpreter
 
About | News | Screenshots | Examples | Downloads | Links | Français

Examples >
Here is a list of easy examples. I hope they will help you to write your first logo programs.

Send me your best realisations, and I'll put them into this page.
 
Let's starting with a simple square <source>
square CS
FD 50
RT 90

FD 50
RT 90

FD 50
RT 90

FD 50
top
And continuing with a circle <source>
circle CS
REPEAT 180 [ FD 1 RT 2 ]
top
More compliquated: now a thorus <source>
thorus //"circle" function
TO circle
  REPEAT 90 [FD 1 RT 4]
END

CS
SETPOS [ 300 400 ]
REPEAT 90
[
  //"circle" function call
  circle
  FD 4 RT 4
]
top
A little bit more interesting: the olympus logo <source>
olympus logo TO circle
  REPEAT 180 [ FD 1 RT 2 ]
END

TO place
  PU
  RT 90
  FD 60
  LT 90
  PD
END

CS
SETPOS [ 230 400 ]

//draw the first ring (blue)
SETPC blue
circle
place

//draw the 2d ring (black)
SETPC black
circle
place
//draw the 3d ring (red)
SETPC red
circle

PU
LT 90
FD 88
LT 90
FD 35
LT 180
PD

//draw the 4th ring (yellow)
SETPC yellow
circle
place

//draw the 5th ring (green)
SETPC green
circle
top
Draw random placed stars <source>
random stars //draw a star
TO star :x :y :long :col
  REPEAT 9
  [
    SETPOS [20+:x 20+:y]
    SETPC :col
    FD :long
    RT 40
  ]
END

//draw nb stars
TO stars :nb
  REPEAT :nb
  [
    GIVE "x HAZARD 350
    GIVE "y HAZARD 350
    GIVE "long HAZARD 25
    GIVE "col HAZARD 15
    star :x :y :long :col
  ]
END
CS
stars 40
SETPOS [150 50]
WRITE "Etoiles
top