Chelone is an interpreter for a subset of the Logo programming language (mostly the turtle parts) implemented in chevrotain.
npm install- Example:
npm run turtle -- -P "to spiral :length if :length > 300 [stop] forward :length right 10 spiral :length * 1.05 end spiral 1" -O output.svg- If run without options (
npm run turtle), will output a demo image toturtle.svg
- If run without options (
If you're not familiar with Logo or turtle graphics, check out the Logo Foundation's Logo Primer.
penup(aliaspu)pendown(aliaspd)forward <amount>(aliasfd)backward <amount>(aliasbk)right <degrees>(aliasrt)left <degrees>(aliaslt)homesetxy <x> <y>(relative to the origin)
repeat <count> [<statements>]to <procedure> :<inputA> :<inputB> :<inputC> <statements> endmake "<variable> <value>
if <valueA> = <valueB> [<statements>]=,!=,>,<
stopin arepeatorprocedureto end executionoutputin aprocedureto return a value
+,-,*,/, unary-random <max>(random integer from 0 to max exclusive)
In Greek myth, Chelone was a nymph who was turned into a tortoise because she didn't RSVP to Zeus and Hera's wedding.