hs-logo

Logo turtle graphics interpreter

Overview

hs-logo is an interpreter for the Logo Programming Language, written in Haskell. It is specialised for Turtle graphics, and is not intended to be a full-fledged Logo interpreter.

Read the installation guide , and then browse the examples to get started. You can execute your logo files to generate an image like below. A more detailed user guide will be added soon.

% hs-logo example.logo -o example.svg

The interpreter is still a work in progress, and more primitives will be added soon. I also plan to write user guide sometime before the next release. You can find the sources at the hs-logo project on github.

Highlights

sun.logo

repeat 2000 [pu home seth random 361 setpencolor random 15 fd 40 pd fd random 200]
sun.logo

moire.logo

setpencolor 1 repeat 180 [fd 500 bk 500 rt 2]
moire.logo

spiral.logo

for [ i 0.01 4 0.05 ] [ repeat 180 [ fd :i rt 1 ] ]
spiral.logo

rotating_circle.logo

repeat 400 [repeat 34 [fd 12 rt 10] rt 90]
rotating_circle.logo

snowflake.logo

setpensize 4
to side :size :level
ifelse :level = 0
  [ fd :size ]
  [ side :size / 3 :level - 1
    lt 60
    side :size / 3 :level - 1
    rt 120
    side :size / 3 :level - 1
    lt 60
    side :size / 3 :level - 1
  ]
end
lt 30
repeat 3 [side 250 4 rt 120]
snowflake.logo

brownian_motion.logo

repeat 10000 [setpencolor random 15 fd 3 * (-1 + random 2) rt 90 * random 4]
brownian_motion.logo