Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated README

  * Added a small documentation

Signed-off-by: Michael Jostmeyer <michael@josi.de>
  • Loading branch information...
commit 4fd8984c99ec8d7606ad3a9d194a81fa2c9e45bd 1 parent e7bb331
Michael Jostmeyer authored
Showing with 27 additions and 0 deletions.
  1. +27 −0 README
27 README
View
@@ -0,0 +1,27 @@
+Documentation
+
+- Create a canvas
+ Example:
+ <canvas id="mycanvas" width="800" height="800"></canvas>
+
+- Create a Turtle
+ Example:
+ var canvas = document.getElementById('mycanvas');
+ if (canvas.getContext) {
+ turtle = new Turtle(canvas.getContext('2d'));
+ }
+
+- Start drawing
+ Example:
+ turtle.pd().fd(10).lt(45).fd(10).pu();
+
+- Implemented commands for now:
+ fd(x): move (and paint if pen is down) forward x pixel
+ lt(x): turn left by x degrees,
+ rt(x): turn right by x degrees,
+ pu(): penUp, means that the turtle won't draw,
+ pd(): penDown, means that the turtle will draw
+
+- planned:
+ cp(color): change color of pen,
+ bd(x): move backward (fd(-x))
Please sign in to comment.
Something went wrong with that request. Please try again.