A nascent LOGO-like library built in p5.js
Go to file
2021-01-21 04:47:55 -05:00
lib added penColor() and penSize() functions 2021-01-21 04:44:54 -05:00
favicon.ico add turtle favicon 2021-01-21 04:21:17 -05:00
index.html add favicon.ico 2021-01-21 04:28:03 -05:00
README.md add more commands to reference section 2021-01-21 04:44:35 -05:00
turtle.js update turtle.js 2021-01-21 04:47:55 -05:00

PLOGO

Purchase LOGO

A toy language.

A kind of LOGO-like DSL built in the p5.js library.

This is a rudimentary proof of concept right now with globals and without implementing classes or ability to loop.

How to Use

Put your code inside the turtle function in turtle.js

Reference Commands

//movement

forward(n); //moves n pixels ahead

back(n); //moves n pixels back

left(Δ);  //turns Δ degrees to the left

right(Δ); //turns Δ degrees to the right

//drawing

penup(); //will draw a line with movement commands

pendown(); //will move to x,y coordinates without drawing line
           //By default, pendown is on / true
penColor('colorName'); //any color word: purple, grey, blue, etc.
		       //color name must be in single or double quotes!
                       //or a HTML color like #ff4d4d (in quotes!)
penSize(n);	       //width of pen in pixels
		       
//randomness

randint(n); //returns a random int between 0 and n (exclusive)
	    //if no input, default is between 0 and 100
            //example: forward(randint(30));