Turtle Art

From OLPC
Revision as of 09:25, 5 December 2008 by Skierpage (talk | contribs) (missing closing </gallery> tag?)
Jump to navigation Jump to search
  english | español HowTo [ID# 184390]  +/-  
Turtleart.png This activity was bundled
TST
Trac print.png Tickets all - active - new
Translate-icon-55px.svg Localization
.POT file NEEDED

OlpcProject.png Brian Silverman

see more templates or propose new

Turtle Art is an activity with a Logo-inspired graphical "turtle" that draws colorful art based on Scratch-like snap-together visual programming elements.

There are many restrictions compared to LOGO. The two allowed user-defined procedures can't have parameters. Only two numeric global variables are available, no lists or other data-structures. You can't make user defined functions which return a value. The conditionals and some of the functions only take constants or variables, not expressions. Limited screen real-estate makes building large programs unfeasible.

To download a tutorial intended for children about turtle art, go to the Turtle Art student guide!.

Palettes

There are five palettes of program elements available for program construction. You add blocks to your program by dragging them from the palette to the main area. You can delete a block by dragging it back onto the palette. Click anywhere on an existing "stack" of blocks to start executing that stack.

Turtle (green)

  • Clean - clear the screen and reset the turtle to center, pointed up (pen down, bright red)
  • Forward(n)
  • Back(n)
  • Left(angle)
  • Right(angle)
  • Arc(angle,radius)
  • SetYX(x,y)
  • SetH(heading)
  • Turtle state values (can plug into a parameter)
    • X, Y, heading (Zeros for each are center screen, pointed up. Heading is degrees clockwise.)
    • angles are degrees from 0 to 360 (for larger values and smaller values all multiples of 360 are substracted or added to get the value into the range 0..360).
    • Example: 90 means a right angle clockwise, -30 means a 30 degree angle counterclockwise

Pen (cyan)

  • Pen Up
  • Pen Down
  • Set Pen Size(n)
  • Set Color(n)
  • Set Shade(n)
  • Fill Screen(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.

This image shows the correspondence between the color's representative number and the actual color itself. NOTE: Some of these colors will appear differently on the XO screen than they do on a standard computer screen. This image is taken from a screenshot on a Macintosh Mini using Firefox to view this webpage.

Turtle art colors.jpg

Here is a photograph of the Browser Activity on the XO displaying the original website for the preceding image. It should be taken with a large grain of salt, since it is a photo of a laptop screen, and is thus a pretty poor way to reliably show colors. To see the colors available in Turtle Art, the original website should be viewed on an actual XO.

Pic of turtle art colors on xo.jpg

Numbers (violet)

  • 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 block)
    • <, >, = (takes two constants or boxes)
    • and, or, not (takes other conditions)
  • Print(n) - Debugging output. When in full screen mode (Alt-Enter), show a numeric value at the bottom of the screen.

Flow (orange)

  • Wait(n)
  • Forever[stack] (no continuation)
  • Repeat(n)[stack]
  • If(condition)[then]
  • If(condition)[then][else]
  • Stop (no continuation)
  • Connectors:
    • jog right
    • jog down

My blocks (yellow)

  • 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)
    • A glaring limitation: you cannot rename these objects. Thus, you are limited to two procedures and two global variables! Madness! --IanOsgood 13:59, 30 December 2007 (EST)

Program control icons

There are also some icons at the top right for user control:

  • Show/Hide the current program
  • Eraser - clear the screen and reset the turtle (same as the Clean block)
  • Stop (for infinite loops)

Project tab

The Project tab at the top left gives access to sample programs shipped with the activity.

Turtle Art with Sensors

There is a hack combining some of Measure with Turtle Art. See Turtle Art with Sensors for the activity version, and the related Sensor input section of the measure page for details about how this was accomplished.

See also


Gallery

This article is a stub. You can help the OLPC project by expanding it.

Activity Summary

Icon: Sugar icon::Image:Turtleart.png
Genre: Activity genre::General Search and Discovery
Activity group: ,|x|Activity group::x}}
Short description: [[Short description::TODO!, also what genre. A drawing activity you control with Scratch-like snap-together visual programming elements.]]
Description:
Maintainers: ,|x|Contact person::x}}
Repository URL: Source code::http://dev.laptop.org/git?p=projects/turtleart-activity
Available languages: ,|x|Available languages::x}}
Available languages (codes): ,|x|Language code::x}}
Pootle URL:
Related projects: Related projects,|x|Related projects::x}}
Contributors: ,|x|Team member::x}}
URL from which to download the latest .xo bundle Activity bundle::http://dev.laptop.org/~cscott/bundles/TurtleArt-10.xo
Last tested version number: Activity version::10
The releases with which this version of the activity has been tested. ,|x|Software release::x}}
Development status:
Ready for testing (development has progressed to the point where testers should try it out): ,|x|Ready for testing::x}}
smoke tested :
test plan available :
test plan executed :
developer response to testing :