Latest update: April 18, 2024
Here are the notes: http://cs.oregonstate.edu/~mjb/turtle/turtle.pdf
Go here: https://editor.p5js.org/
Go here: https://cs.oregonstate.edu/~mjb/turtle/turtlesetup.html
F(p); | Move forward by p pixels. |
B(p); | Move backwards by p pixels. |
R(d); | Turn to your right by d degrees. |
L(d); | Turn to your left by d degrees. |
C(r,g,b); | Set the color to r,g,b. Each of these numbers needs to be between 0 and 255. |
W(p); | Set the line width to p pixels. |
Now, click on the right-facing triangle to run the program.
Copy-and-paste these lines to become the innards of the draw( ) function:
var b = 100; F( b ); R( 45 ); F( b/2 ); B( b/2 ); L( 90 ); F( b/2 ); B( b/2 ); R( 45 ); B( b );Then run the program.
Copy-and-paste these lines to become the innards of the draw( ) function:
var length = 100; for( var b = 0; b < 6; b = b + 1) { F( length ); R( 45 ); Branch( length/2 ); L( 90 ); Branch( length/2 ); R( 45 ); B( length ); L( 60 ); }Then run the program.
For more information, contact:
Mike Bailey
Oregon State University
Professor, Computer Science
Kelley Engineering Center
Corvallis, OR 97331-0505
mjb@cs.oregonstate.edu