Difference between revisions of "Activities/Turtle Art/Getting started"

From Sugar Labs
Jump to navigation Jump to search
 
(29 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
==Getting Started==
 
==Getting Started==
  
[[Image:TAvertical.png|300px]]
+
There are several Turtle Art manuals:
 +
* [http://ht.ly/gqueN]
 +
 
 +
[[Image:New-TA-Repeat-block.png|300px]]
  
 
Start by clicking on (or dragging) blocks from the Turtle palette. Use multiple blocks to create drawings; as the turtle moves under your control, colorful lines are drawn.
 
Start by clicking on (or dragging) blocks from the Turtle palette. Use multiple blocks to create drawings; as the turtle moves under your control, colorful lines are drawn.
Line 11: Line 14:
 
File:TA-basics.png|Basic turtle graphics: 'forward', 'back', 'arc', and 'right' blocks
 
File:TA-basics.png|Basic turtle graphics: 'forward', 'back', 'arc', and 'right' blocks
 
File:TA-pencolor.png|The 'set color' block affects pen trails, fill and text
 
File:TA-pencolor.png|The 'set color' block affects pen trails, fill and text
 +
</gallery>
 +
<gallery>
 
File:TA-pensize.png|'set pen size' block
 
File:TA-pensize.png|'set pen size' block
 
File:Penupdown.jpg|'pen up' and 'pen down'
 
File:Penupdown.jpg|'pen up' and 'pen down'
Line 19: Line 24:
 
File:turtlesquare.jpg|Use the 'repeat' block to draw shapes
 
File:turtlesquare.jpg|Use the 'repeat' block to draw shapes
 
File:Turtlepolygon.jpg|This can be generalised to n sided polygons, n is stored in 'box 1'
 
File:Turtlepolygon.jpg|This can be generalised to n sided polygons, n is stored in 'box 1'
 +
</gallery>
 +
<gallery>
 
File:Turtlefilledtriangle.jpg|Use 'start fill' and 'end fill' to draw filled shapes
 
File:Turtlefilledtriangle.jpg|Use 'start fill' and 'end fill' to draw filled shapes
 +
File:TA-sample4.png|There's no limit
 +
</gallery>
 +
 +
===Displaying things===
 +
<gallery>
 +
File:Hello world.jpg|Use 'print' to display in the print window
 +
File:TA-text.png|'show' block used to display at the turtle
 +
File:TA-image.png|'show' an image or video
 +
File:Showcamera.jpg|'show' the camera output
 +
File:Showsound.jpg|'show' plays sounds as well
 +
File:Printnumber.jpg|'print' and 'show' can display text or numbers including results of calculations
 +
File:Stringsandnumbers.jpg|'print' or 'show' mixed text and numbers, using '+'
 +
File:Speech.jpg|Text to speech. Load the Python block with the inbuilt sample code <i>speak.py</i>
 
</gallery>
 
</gallery>
  
Line 26: Line 46:
  
 
<gallery>
 
<gallery>
File:TA-box-eample.png|Named variables: 'store in' block
+
File:TA-box-eample.png|Named variables: store a variable in 'box'
 
File:Namedstacks.jpg|Named 'stacks' of blocks can be reused
 
File:Namedstacks.jpg|Named 'stacks' of blocks can be reused
 +
File:ActionBlocks.png|When a new named stack is created, a new action block is added to the palette.
 
File:Collapsestack.jpg|Collapse a 'stack' of blocks to save space
 
File:Collapsestack.jpg|Collapse a 'stack' of blocks to save space
 
File:Pushpop.jpg|Store data in the first in last out heap using 'push' and 'pop'
 
File:Pushpop.jpg|Store data in the first in last out heap using 'push' and 'pop'
File:Turtlearray.jpg|Box names (and stack names) can be boxes, in this case 10 boxes are created. This is a powerful programming feature. A one dimensional array of variables has effectively been created.
+
File:Turtlearray.jpg|Box names (and stack names) can be boxes, in this case (taken from the math-dice project), a one-dimensional array of 11 variables has been created.  
 
</gallery>
 
</gallery>
  
===Displaying things===
+
===Mathematics===
 
<gallery>
 
<gallery>
File:Hello world.jpg|Using 'print' with text
+
File:Mathoperators.jpg |Math operators including + - * / mod sqrt
File:TA-text.png|'show' block used for text
+
File:TA-if.png|Logical operations: flow control blocks accept >, <, =, and, not, or as input
File:Printnumber.jpg|'print' and 'show' can display numbers including results of calculations
+
File:Pie2.png|Make pie charts [http://wiki.sugarlabs.org/go/File:Turtle_Art_Activity_pie_chart.ta]
File:Stringsandnumbers.jpg|'print' with text and numbers
+
File:Functionblock.jpg|Use Python functions, (accepts any of the [http://docs.python.org/library/time.html time] or [http://docs.python.org/library/math.html math] library functions)
File:TA-image.png|'show' an image or video
+
File:Coordinates.png|Cartesian and polar coordinate grids
File:Showcamera.jpg|'show' the camera output
+
File:CM-coordinate-grid.svg|Centimeter coordinate grid (XO only)
File:Showsound.jpg|'show' plays sounds as well
 
File:Speech.jpg|Text to speech. Load the Python block with the inbuilt sample code <i>speak.py</i>
 
 
</gallery>
 
</gallery>
  
Line 49: Line 68:
 
File:Keyboardinput.jpg|Reading the keyboard
 
File:Keyboardinput.jpg|Reading the keyboard
 
File:Keyboard.png|Converting the keyboard output to a string
 
File:Keyboard.png|Converting the keyboard output to a string
File:Entertermnumber.jpg|Getting a multi digit number [[http://wiki.sugarlabs.org/go/File:Turtle_Art_getnumber.ta]]
+
File:Entertermnumber.jpg|Entering a multi digit number, exits with the number in 'box 1', [[http://wiki.sugarlabs.org/go/File:Turtle_Art_getnumber.ta]]
 
File:Turtlemouse.jpg|Load the Python block with the sample code <i>push_mouse_event.py</i> to read mouse events
 
File:Turtlemouse.jpg|Load the Python block with the sample code <i>push_mouse_event.py</i> to read mouse events
 
File:Printloudness.jpg|Read the microphone  
 
File:Printloudness.jpg|Read the microphone  
 
File:Resistance.jpg|Read sensors plugged into the microphone socket [http://wiki.sugarlabs.org/go/Activities/TurtleArt/Using_Turtle_Art_Sensors]
 
File:Resistance.jpg|Read sensors plugged into the microphone socket [http://wiki.sugarlabs.org/go/Activities/TurtleArt/Using_Turtle_Art_Sensors]
</gallery>
 
 
===Mathematics===
 
<gallery>
 
File:TA-if.png|logical operations: 'if' block
 
File:Pie2.png|Make pie charts
 
File:Functionblock.jpg|Use Python functions, (accepts any of the [http://docs.python.org/library/time.html time] or [http://docs.python.org/library/math.html math] library functions)
 
 
</gallery>
 
</gallery>

Latest revision as of 17:22, 29 December 2012

Getting Started

There are several Turtle Art manuals:

New-TA-Repeat-block.png

Start by clicking on (or dragging) blocks from the Turtle palette. Use multiple blocks to create drawings; as the turtle moves under your control, colorful lines are drawn.

You add blocks to your program by clicking on or dragging them from the palette to the main area. You can delete a block by dragging it back onto the palette. Click anywhere on a "stack" of blocks to start executing that stack or by clicking in the Rabbit (fast) , Turtle (slow) or Bug (debug) buttons Rabbitturtle.jpg on the Project Toolbar.

The basics

Drawing shapes

Displaying things

Boxes, Stacks and the Heap

(aka variables, subroutines and the stack)

Mathematics

Keyboard, mouse and sensor input