raimohanska / turtle-js

Turtle Roy translated to Javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Turtle JS

A Javascript port of Turtle Roy

Try it online: turtle-js.heroku.com/

TurtleAPI

Command Result
fd(100) moves 100 pixels forward
bk(100) moves 100 pixels backward
lt(45) turns left 45 degrees
rt(90) turns right 90 degrees
penup() lifts the pen, no trace left when moving
pendown() lowers the pen again for drawing
setshape("rocket-large") changes the cursor. available (with and without -large): butterfly, car, fairy, formula, princess, rocket, turtle
clear() clear the paper and reset turtle to center
home() reset the turtle to center
login("raimo") login as "raimo" (this is the author name in your saved work)
save("asdf") save current work as "asdf"
open("asdf") open saved work "asdf" (presuming you've saved with this name and current author name)
whoami() show the author name of the logged-in user (this is just saved in a cookie)
ls() list your saved works
bg("red") change background color (red, rgb(255,0,0), #FF0000)
color("red") change pen color (red, rgb(255,0,0), #FF0000)
penwidth(4) change pen width to 4 pixels
text("HELLO") draw the text "HELLO" beside the turtle
font("40px Arial") changes to the 40px Arial font
font(100) changes to the 100px Courier font
speak("Ninja turtles") read loud the text (if sound is enabled)

Building and running

Build (and rebuild on javascript changes)

npm install
grunt

Run the server (node.js / express)

./server

And

open http://localhost:8070

Optionally also start the mongo db

./runmongo

Credits

See origins of the cursor images from src/main/webapp/images/image-sources.txt

About

Turtle Roy translated to Javascript


Languages

Language:C++ 66.0%Language:C 18.5%Language:HTML 9.9%Language:JavaScript 3.4%Language:Inno Setup 1.2%Language:Makefile 0.4%Language:CSS 0.3%Language:Shell 0.2%Language:Python 0.1%Language:CoffeeScript 0.0%