Skip to content

Example Idea: Logo Interpreter #12

Open
@sunjay

Description

@sunjay

This library and other libraries like it in other languages are based on the LOGO programming language. It would be really cool if we could have an example that interprets logo commands.

Logo Reference: http://www.logointerpreter.com/logo-reference/turtle-graphics-basic-motion.php
Logo Tutorial: http://cs.brown.edu/courses/bridge/1997/Resources/LogoTutorial.html

The example could either accept input or run a file depending on the command line arguments provided. Feel free to make this as fancy or simple as you want!


Progress

Suggested Future Enhancements

Please ask questions in the comments or on Zulip if you need more help with any of this!

For every feature in this list, make sure you submit an example (in the examples/sample_logo_programs directory) to go with what you implemented so we can check that it works.

  • Support comments on their own line or following a line in the program
    Instructions: Before we use split_whitespace to split the line into its arguments, split by the ; character up to one time and use the first half as the line to parse and evaluate.
  • Support more commands
    Instructions: See the logo reference for a complete list of the commands that you could implement. Feel free to do as many as you can or as few as you want.
  • Write/copy example logo programs
    Instructions: Find good, informative logo sample programs and add them to the examples/sample_logo_programs directory. Creativity is encouraged so please don't hesitate to make your own! The more interesting, the better.
  • Support repeat command and other related commands (see tutorial for an example)
    Instructions: Add a repeat command in a similar way to how other commands are implemented, but figure out how to parse instruction lists (ask if you are not sure how to approach this)
  • Support if command (see tutorial for an example)
    Instructions: Add an if command in a similar way to how other commands are implemented. You will need to split up parsing and evaluation into two separate functions because if should not evaluate its body if its condition is false. Try to avoid parsing more than necessary (don't parse the entire file at once). To accomplish this, you will need to make sure of Iterators or some other related concept.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions