Turtle Art: Difference between revisions

From OLPC
Jump to navigation Jump to search
(Print: nonfunctional?)
(reformat to use headings)
Line 25: Line 25:
There are many restrictions compared to Logo. User defined procedures can't have parameters. Limited screen real-estate makes building large programs infeasible. Only simple 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.
There are many restrictions compared to Logo. User defined procedures can't have parameters. Limited screen real-estate makes building large programs infeasible. Only simple 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.


==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.
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.
*Turtle (green)
===Turtle (green)===
**Clean - clear the screen and reset the turtle to center, pointed up (pen down, red, opaque)
*Clean - clear the screen and reset the turtle to center, pointed up (pen down, red, opaque)
**Forward(n)
*Forward(n)
**Back(n)
*Back(n)
**Left(angle)
*Left(angle)
**Right(angle)
*Right(angle)
**Arc(angle,radius)
*Arc(angle,radius)
**SetYX(x,y)
*SetYX(x,y)
**SetH(heading)
*SetH(heading)
**Turtle state values (can plug into a parameter)
*Turtle state values (can plug into a parameter)
***X, Y, heading
**X, Y, heading
*Pen (cyan)
===Pen (cyan)===
** Pen Up
* Pen Up
** Pen Down
* Pen Down
** Set Pen Size(n)
* Set Pen Size(n)
** Set Color(n)
* Set Color(n)
** Set Shade(n)
* Set Shade(n)
** Fill Screen(color,shade)
* Fill Screen(color,shade)
** Pen state values (can plug into a parameter)
* Pen state values (can plug into a parameter)
*** Pen size, color, shade
** Pen size, color, shade
** '''Any idea of the allowed ranges of these variables?'''
*Numbers (violet)
===Numbers (violet)===
**Values (can plug into a parameter)
*Values (can plug into a parameter)
***Number (constant)
**Number (constant)
***Infix operators(left,right)
**Infix operators(left,right)
**** +, -, *, /, mod
*** +, -, *, /, mod
***Random(min, max) (constants or boxes only)
**Random(min, max) (constants or boxes only)
**Conditions (oval, plugs into an If block)
*Conditions (oval, plugs into an If block)
*** <, >, = (takes two constants or boxes)
*** and, or, not (takes other conditions)
** <, >, = (takes two constants or boxes)
** and, or, not (takes other conditions)
**Print(n)
*Print(n)
***''This doesn't seem to do anything on the G1G1 builds --[[User:IanOsgood|IanOsgood]] 13:59, 30 December 2007 (EST)''
**''Print doesn't seem to do anything on the G1G1 builds --[[User:IanOsgood|IanOsgood]] 13:59, 30 December 2007 (EST)''
*Flow (orange)
===Flow (orange)===
**Wait(n)
*Wait(n)
**Forever[stack] (no continuation)
**Repeat(n)[stack]
*Forever[stack] (no continuation)
*Repeat(n)[stack]
**If(condition)[then]
**If(condition)[then][else]
*If(condition)[then]
*If(condition)[then][else]
**Stop (no continuation)
*Stop (no continuation)
**Connectors:
*Connectors:
***jog right
***jog down
**jog right
**jog down
*My blocks (yellow)
===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)
*Stack1,2 - a rhombus which tops a stack, equivalent to a procedure definition (but without parameters).
**Store in "box" 1,2(n) - blocks for setting a variable
*"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)
*"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! --[[User:IanOsgood|IanOsgood]] 13:59, 30 December 2007 (EST)''
**''A glaring limitation: you cannot rename these objects. Thus, you are limited to two procedures and two global variables! Madness! --[[User:IanOsgood|IanOsgood]] 13:59, 30 December 2007 (EST)''


==Program control icons==
There are also some icons at the bottom right for user control:
There are also some icons at the bottom right for user control:
* Show/Hide the current program
* Show/Hide the current program
* Eraser - clear the screen and reset the turtle (same as the Clean block)
* Eraser - clear the screen and reset the turtle (same as the Clean block)
* Stop (for infinite loops)
* Stop (for infinite loops)

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


{{-}}
{{-}}

Revision as of 19:08, 30 December 2007

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. User defined procedures can't have parameters. Limited screen real-estate makes building large programs infeasible. Only simple 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.

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.

Turtle (green)

  • Clean - clear the screen and reset the turtle to center, pointed up (pen down, red, opaque)
  • 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

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
    • Any idea of the allowed ranges of these variables?

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)
    • Print doesn't seem to do anything on the G1G1 builds --IanOsgood 13:59, 30 December 2007 (EST)

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 bottom 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.


<gallery> Image:Turtle0.png|Turtle Art startup screen Image:Turtle1.png|Clicking on the Blocks menu brings the basic tool set into view Image:Turtle2.png|Drag blocks from the menu Image:Turtle3.png|Click on the top block of a stack to execute the stack Image:Turtle4.png|Other blocks can be found under the tabs Image:Turtle5.png| Image:Turtle6.png|Example projects are found on the Projects menu on the upper right of the screen Image:542-turtleart-2.png Image:Turtle-recursion-1.jpg|A recursive algorithm (difficult without parameters)

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