Cat Interpreter in JavaScript with Turtle Graphics

Ehud recently lamented the lack of small interpreters for people to play with. I thought I would take this as an invitation share my JavaScript version of Cat that supports turtle graphics:

http://cat-language.com/interpreter.html

The parsing code will definitely make the angels weep and programmers gnash their teeth.

Enjoy!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

exception caught: TypeError, Undefined value

Thanks, but in Safari the graphical directives are not defined (set_color, fill_ellipse etc). Seems to work in Mozilla though.

ogoL

Took me a second to realize the rt is tr and lt is tl. cs is clear_output (but if I am not mistaken does not take the turtle back home).