A logo interpreter and tortoise (turtle) graphics emulator in Javascript with HTML5 Canvas
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
cm
.gitignore
README.md
index.html
jquery.js
logo.js
tortoise.css
tortoise.js
tortoise.logo

README.md

Logo Tortoise

What is this?

The thing that got me interested in programming way back in 1987 was the BBC Micro that sat in my primary school classroom. One day, the teacher hooked it up to a robot "turtle", which held a pen over a large sheet of paper on the ground and could be made to move around and draw by way of writing programs on the computer.

This repository is a attempt to recreate the magical experience I had that day.

What can I do with it?

This is still unfinished, but you can draw pictures using Logo programs that you can type into the area at the bottom of the page. An example program is preloaded.

The interpreter understands the following keywords:

forward x
Move forward x steps
right x
Turn right x degrees
left x
Turn left x degrees
penup
Stop drawing lines when moving
pendown
Start drawing lines when moving
repeat x [ instructions ]
Repeat instructions x times
to verb parameters instructions end
Defines the function verb, optionally taking parameters listed in the form :x, so that you can subsequently write verb and instructions will be performed
Eg:
to square :x repeat 4 right 90 forward :x end
square 20
if expression [ instructions ]
Performs instructions if expression evaluates to true

Currently, expressions are only accepted by the if keyword, so you can't do forward 1 + 1, for example.

Why are you calling it a tortoise?

Because turtles are aquatic. Artistic tortoises make more sense to me.

It doesn't work

Yeah, I've only tested it in Chrome, Firefox 7 and Safari 5 so far. It's a work in progress.