Skip to content

knewter/logo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

This is a Logo implementation for Elixir. We would ultimately like to support a parser for the logo language. For now we'll provide the primitives necessary, but stop short of building the parser. Our dream is to support this:

Logo.evaluate("""
COLOR [255 0 0]
PENDOWN
FORWARD 400
RIGHT 90
FORWARD 200
RIGHT 180
FORWARD 400
""")

This should draw a T. Since we have no parser yet, we would expect that to evaluate to something like this, which we do support presently.

{:ok, logo} = Logo.Instance.start
logo
|> color({255, 0, 0})
|> pen_down
|> forward(400)
|> right(90)
|> forward(200)
|> right(180)
|> forward(400)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published