Activities/Turtle Art-0.86: Difference between revisions
| Line 99: | Line 99: | ||
* Angles are degrees from 0 to 360 (for larger values and smaller values all multiples of 360 are subtracted or added to get the value into the range 0..360). | * Angles are degrees from 0 to 360 (for larger values and smaller values all multiples of 360 are subtracted or added to get the value into the range 0..360). | ||
::Examples: 90 means a right angle (90 degrees), clockwise; –30 means a 30-degree angle, counterclockwise | ::Examples: 90 means a right angle (90 degrees), clockwise; –30 means a 30-degree angle, counterclockwise | ||
===The Pen Palette (cyan)=== | |||
====examples==== | |||
====descriptions==== | |||
* Pen Up – turtle will not draw when moved | |||
* Pen Down – turtle will draw when moved | |||
* Set Pen Size(number) – set size of the line drawn by the turtle | |||
* Set Color(number) – set color of the line drawn by the turtle | |||
* Set Shade(number) – set shade of the line drawn by the turtle | |||
* Fill Screen(color,shade) – fills the background with (color, shade) | |||
* Pen state values (can plug into a parameter) | |||
** Pen size, color, shade | |||
** Colors and shades are represented by a number from 0 through 99. Using a number outside of this range is allowed, and will cause the value to be "wrapped around" (via a modulo, or "clock arithmetic" operation) to the 0 – 99 range. Color specifies a hue and shade specifies an admixture of white or black to the color. | |||
===The Numbers Palette (purple)=== | |||
====examples==== | |||
====descriptions==== | |||
*Values (can plug into a parameter) | |||
**Number (constant) | |||
**Infix operators(left,right) | |||
*** +, –, *, /, mod | |||
**Random(min, max) (constants or boxes only) | |||
*Conditions (oval, plugs into an If blocks on the Flow Palette) | |||
** <, >, = (takes two constants or boxes) | |||
** and, or, not (takes other conditions) | |||
*Print(number) - Debugging output. When in full-screen mode ('''Alt-Enter'''), show a numeric value at the bottom of the screen. | |||
===The Sensors and Keyboard Palette (red)=== | |||
====examples==== | |||
====descriptions==== | |||
*volume | |||
*pitch | |||
*voltage – (As read from mic in on the OLPC-XO-1 laptop) | |||
*resistance – (As read from the mic in on the OLPC-XO-1 laptop) | |||
More details on how to use the sensors can be found on the [http://wiki.laptop.org/go/Measure Measure] Activity page. | |||
===The Flow Palette (orange)=== | |||
====examples==== | |||
====descriptions==== | |||
*Wait(number) – wait specified number of seconds | |||
*Forever[stack] – (no continuation) | |||
*Repeat(number)[stack] – loop specified number of times | |||
*If(condition)[then] – uses boolean operators from Numbers palette | |||
*If(condition)[then][else] – uses boolean operators from Numbers palette | |||
*Stop (no continuation) | |||
*Connectors: | |||
**jog right | |||
**jog down | |||
===The My Blocks Palette (yellow)=== | |||
====examples==== | |||
====descriptions==== | |||
*Stack1,2 – a rhombus which tops a stack, equivalent to a procedure definition (but without parameters). | |||
*"Stack1,2" – blocks for invoking a stack (no parameters) | |||
*Store in "box" 1,2(n) – blocks for setting a variable | |||
*"Box1,2" (plugs into a parameter) | |||
==Save As Toolbar== | |||
The Project tab (at the top left of the toolbar) has a button to access sample programs shipped with the Activity. It also has a export button to save the project into the Journal as a [[Berkeley Logo]] session (logosession.lg), | |||
[[Category:Activity]] | |||