|lee2sman c237937fe7||2 years ago|
|examples||2 years ago|
|lib||2 years ago|
|README.md||2 years ago|
|favicon.ico||2 years ago|
|index.html||2 years ago|
|style.css||2 years ago|
|turtle.js||2 years ago|
(currently named for my uni).
A toy language.
A kind of LOGO-like DSL built in the p5.js library.
How to Use
Put your code inside the turtle function in turtle.js
move n pixels ahead
move n pixels back
turns Δ degrees to the left
turns Δ degrees to the right
moves turtle to x,y pixel coordinate. 0,0 is top left of window.
Going forward, Turtle will stop drawing a line with movement commands
Turtle will start drawing lines tracing route. By default, pendown is on / true
penColor takes any color word: purple, grey, blue, etc. The color name must be in quotes.
Alternatively, a HTML color name, like #ff4d4d, may be specified in quotes. Example:
Alternatively, a RGB color or RGBA color with transparency can be specified, with color. Example:
penColor(color(255,0,255)). See transparency example in examples section below.
Width of pen in pixels
Adds a retro filter on the entire drawing. This command can be called anywhere and filter is always applied at the end of the program.
Turns off the default onscreen display of the program listing.
Returns a random int between 0 and n. Specifying a value is optional. If no input n, the default is between 0 and 100. Example:
See examples folder.
- Added onscreen console print of commands (on by default) and noConsole() to turn off
- Added more example files
- Re-render turtle() after screen resizing
- Added new setpos(x,y) function to move turtle to a position. A path will be drawn if the pen is currently down.
- add retro() command for retro filter.