Changes

Jump to navigation Jump to search
37,099 bytes removed ,  10:45, 17 October 2015
m
Line 1: Line 1: −
<noinclude>{{Translations | [[Activities/Turtle Art|english]] &#124; [[Activities/Turtle Art/lang-es|español]] &#124;}}{{TOCright}}
+
<noinclude>{{Translations | [[Activities/Turtle Art|english]] &#124; [[Activities/Turtle Art/lang-es|español]] &#124;}}
 
[[Category:Activities|Turtle Art]]</noinclude>
 
[[Category:Activities|Turtle Art]]</noinclude>
   −
==What is Turtle Art==
+
== What is Turtle Blocks (AKA Turtle Art)==
   −
Turtle Art is an activity with a Logo-inspired graphical "turtle" that draws colorful art based on snap-together visual programming elements.
+
Turtle Blocks is an activity with a [https://logothings.wikispaces.com/ Logo-inspired] graphical "turtle" that draws colorful art based on snap-together visual programming elements. Its "low floor" provides an easy entry point for beginners. It also has "high ceiling" programming features which will challenge the more adventurous student.
   −
'''Note:''' There are two inter-compatible programs: Turtle Art and Turtle Blocks. Turtle Art, which closely parallels the Java version of Turtle Art maintained by Brian Silverman, offers a small subset of the functionality of Turtle Blocks.
+
=== Where to get Turtle Blocks ===
   −
==Where to get Turtle Art==
+
http://activities.sugarlabs.org/en-US/sugar/addon/4027
   −
<span class="linkgroup">[[File:Activity-turtleart.png|link=http://activities.sugarlabs.org/en-US/sugar/addon/4027]]</span>
+
'''Note:''' There are two inter-compatible programs: [http://activities.sugarlabs.org/en-US/sugar/addon/4298 Turtle Art] and [http://activities.sugarlabs.org/en-US/sugar/addon/4027 Turtle Blocks]. Turtle Art, which closely parallels the Java version of Turtle Art maintained by Brian Silverman, offers a small subset of the functionality of Turtle Blocks. '''Sugar users probably want to use Turtle Blocks rather than Turtle Art.''' (Also see [[Activities/Turtle Confusion|Turtle Confusion]], a collection of programming challenges designed by Barry Newell; as well as the [[Activities/TurtleFlags]], [[Activities/Tortuga de Mexico]] and [[Activities/Amazonas Tortuga]] variants.)
   −
Turtle Art is a [[Taxonomy#Fructose:_The_set_of_demonstration_activities|Fructose module]], so it is included as part of the standard Sugar (Sucrose = Glucose+Fructose) distribution.
+
Debian (and Ubuntu) users can install Turtle Blocks from a repository maintained by Alan Aguiar (https://launchpad.net/~alanjas/+archive/turtleblocks):
 +
# sudo add-apt-repository ppa:alanjas/turtleblocks
 +
# sudo apt-get update
 +
# sudo apt-get install turtleblocks
   −
'''Sugar Activity Library'''
+
Fedora users can do:
* [http://activities.sugarlabs.org/en-US/sugar/addon/4298 Version 89 of Turtle Art]
+
# <strike>sudo yum install turtleblocks</strike>
* [http://activities.sugarlabs.org/en-US/sugar/addon/4027 Version 106 of Turtle Blocks]
+
# sudo yum install sugar-turtleart
* [http://activities.sugarlabs.org/en-US/sugar/addon/4027 download]
  −
<!-- * [[File:TurtleArt-106.xo|Experimental Version 106 (beta) of Turtle Blocks]] -->
  −
'''Sources'''
  −
* [http://git.sugarlabs.org/projects/turtleart git source]
  −
* [http://download.sugarlabs.org/sources/sucrose/fructose/TurtleArt/?C=M;O=D tarballs]
  −
'''Manuals & Guides'''
  −
* [[Activities/TurtleArt/Turtlecards|Turtle Cards]]
  −
<!-- {{Iframe|&nbsp;&nbsp;http://wiki.sugarlabs.org/skins/vector/images/bullet-icon.png &nbsp;[http://en.flossmanuals.net/turtleart Turtle Art FLOSS Manual] |http://en.flossmanuals.net/turtleart|940|600|1}} -->
  −
* [http://en.flossmanuals.net/turtleart FLOSS Turtle Art manual]
  −
* [http://wiki.laptop.org/go/Turtle_Art_student_guide Student Guide]
  −
* [http://www.reducativa.com/wiki/index.php?title=Proyecto_OLPC_-_Plan_Ceibal#Turtle_Art activity guides (es)]
  −
* [http://ceibalpuertosauce.blogspot.com/2009/06/tortugarte.html mas TortugaArte]
  −
* [http://neoparaiso.com/logo/que-es-logo.html ¿Qué es Logo?]
  −
* [http://neoparaiso.com/logo/ejercicios-de-geometria.html 84 Ejercicios de Geometría]
  −
* [http://dspace.mit.edu/bitstream/handle/1721.1/5787/AIM-356.pdf;jsessionid=92BD7E499ECB9BB8F8350EF04B8063B3?sequence=2 Logo Progress Report 1973-1975]
  −
* http://www.mochiladigitaltelmex.com.mx/pdf/xo/TortugArte.pdf
  −
'''Galleries'''
  −
* [http://turtleartsite.appspot.com/ Python Turtle Art Gallery]
  −
* [http://www.turtleart.org/ Java Turtle Art Gallery]
  −
* [http://neoparaiso.com/logo/galeria-graficos-de-tortuga.html Another Turtle Art gallery]
  −
* [http://sites.google.com/site/godiard/TurtleArt.ppt?attredirects=0&d=1 (archivo en PowerPoint)]
  −
'''Blogs'''
  −
* [http://billkerr2.blogspot.com/2009/08/40-maths-shapes-challenges.html 40 shapes challenge]
  −
* [http://xo-cesaraguero.blogspot.com Caacupé]
  −
* [http://formando-artistas.blogspot.com/ Club ¡Formando Artistas con la Tortuga!]
  −
* [http://aprendiendodelaxo.blogspot.com Capacitacion y seguimiento de Formadores para el acceso a la XO!!]
  −
* [http://xomimundo.blogspot.com/2010/08/bicentenario-del-paraguay.html  Flags of Paraguay]
  −
* [http://miguela-xo.blogspot.com/ student blog]
  −
'''Other wiki pages'''
  −
* [[Activities/TurtleArt/Arduino|Turtle Art Arduino]]
  −
* [http://wiki.laptop.org/go/Category:Aplicaciones_de_Actividad_TortugArte Aplicaciones de Actividad TortugArte]
  −
'''Release notes'''
  −
* [[0.90/TurtleArt|Fructose 0.90 release notes]]
  −
* [[0.88/TurtleArt|Fructose 0.88 release notes]]
  −
* [[0.86/TurtleArt|Fructose 0.86 release notes]]
  −
'''Video'''
  −
* [http://www.dailymotion.com/sugarlabs/video/15708788 Introductory video]
  −
* http://www.mediagala.com/rap/videos/tortugarte/flv/Turtle_Charla_4.html
  −
'''Bugs'''
  −
* [http://bugs.sugarlabs.org/query?component=Turtleart&col=id&col=summary&col=component&col=type&col=status&col=priority&col=milestone&col=time&col=changetime&order=priority Sugar Labs tickets], [http://dev.laptop.org/query?component=turtleart-activity&col=id&col=summary&col=component&col=type&col=status&col=priority&col=milestone&col=time&col=changetime&order=priority OLPC tickets]
      +
For those of you who would like to use Turtle Blocks in a browser, there is a mostly compatible version at [http://turtle.sugarlabs.org Turtle Blocks JS]. See [https://github.com/walterbender/turtleblocksjs/blob/master/guide/README.md the Guide] ([https://github.com/walterbender/turtleblocksjs/blob/master/guide-es/README.md en ES]) for more details.
    +
Finally, there is [http://walterbender.github.io/musicblocks Music Blocks], a musical fork of Turtle Blocks. See [https://github.com/walterbender/musicblocks/blob/master/guide/README.md the Guide] for more details.
   −
=== i18n ===
+
{{:Activities/Turtle Art/Getting_started}}
   −
Turtle Art currently has support for: de, el, en, es, fa_AF, fi, fr, hi, it, mn, nl, ps, pt, ru, sl, sv, ta, tr, vi, and zh_TW
+
{{:Activities/Turtle Art/Turtle_Cards}}
   −
(See [http://translate.sugarlabs.org our Pootle server] for details about how to translate Turtle Art into your language.)
+
{{:Activities/Turtle Art/Challenges}}
   −
=== Reporting bugs ===
+
{{:Activities/Turtle Art/Toolbars}}
   −
Please file bug reports [https://bugs.sugarlabs.org/newticket?component=Turtleart here].
+
{{:Activities/Turtle Art/Extras}}
   −
==Background==
+
{{:Activities/Turtle Art/Tutorials}}
   −
Turtle Art is intended to be a stepping stone to  the Logo programming language, but there are many restrictions compared to Logo. (Only numeric global variables and stack items are available, no lists or other data-structures. The conditionals and some of the functions only take constants or variables, not expressions. Limited screen real-estate makes building large programs unfeasible.) However, you can export your Turtle Art creations to [[#Exporting to Berkeley Logo|Berkeley Logo]].
+
{{:Activities/Turtle Art/Galleries}}
   −
Turtle Art was written by Brian Silverman and is maintained by Walter Bender. Arjun Sarwal added the sensor features. Luis Michelena contributed to the "named" action and box blocks. Tony Forster has been the lead test engineer and has really [[#From_the_field|stretched the boundaries]] of Turtle Art. Raúl Gutiérrez Segalés has been a major contributor to the refactoring of the Turtle Art code base starting with Version 0.83.
+
{{:Activities/Turtle Art/Portfolios}}
   −
=== Branches ===
+
{{:Activities/Turtle Art/Logo}}
A [[Activities/Turtle Art/Templates|portfolio feature]] lets you use Turtle Art to create multimedia slide shows from material retrieved from your Journal. The basic idea is to import images (and eventually movies, audio, and text files) into slide templates, not unlike Powerpoint, and then show a presentation by stepping through them. The portfolio includes the typical major functions of presentation software: an editor that allows text to be inserted and formatted (this is largely incomplete), a method for inserting images (from the Journal), and a slide-show system to display the content. What makes it a bit different than tools such as Powerpoint is that you can program your slides using Turtle Art blocks. Turtle Art also has an export-to-HTML function so that presentations can be viewed outside of the Sugar environment. (These features have been merged into the main branch of Turtle Art.)
     −
==== Turtle Art with Arduino ====
+
{{:Activities/Turtle Art/Programmable_Brick}}
[[Activities/TurtleArt/Arduino|Turtle Art with Arduino]] support is an extension of Turtle Art that supports data capture from the Arduino board. This branch is maintained by Sayamindu Dasgupta and Rafael Ortiz.
     −
{{:Activities/TurtleArt/Galleries}}
+
{{:Activities/Turtle Art/Plugins}}
   −
==Getting Started==
+
{{:Activities/Turtle Art/Misc}}
   −
[[Image:TAvertical.png|300px]]
+
{{:Activities/Turtle Art/Under_the_hood}}
   −
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.
+
{{:Activities/Turtle Art/Packaging}}
   −
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) or Turtle (slow) buttons on the Project Toolbar.
+
== Credits ==
 
+
* Walter Bender and Raúl Gutiérrez Segalés maintain the code (with some occasional help from Simon Schampijer)
<gallery>
+
* Especially helpful feedback from Tony Forster, Guzmán Trinidad, and Bill Kerr
File:TA-basics.png|basic turtle graphics: 'forward', 'back', 'arc', and 'right' blocks
+
* Matthew Gallagher works on packaging and wrote the project-upload code
File:TA-text.png|'show' block used for text
+
* Brian Silverman is the first author of Turtle Art
File:TA-image.png|multimedia: 'show' block used for image (movies, audio)
  −
File:TA-pencolor.png|pen attributes: 'set pen color' block
  −
File:TA-pensize.png|'set pen size' block
  −
File:TA-if.png|logical operations: 'if' block
  −
File:TA-box-eample.png|named variables:'store in' block
  −
</gallery>
  −
 
  −
===Video Tutorials===
  −
I know there are a few but they are not categorized on this page... we'll make that happen soon. Help would be appreciated.
  −
 
  −
* [http://www.youtube.com/results?search_query=pleabargain+sugar+turtle+art&search_type=&aq=o introductory videos here on Turtle Art]
  −
* [http://www.dailymotion.com/video/xa71j3_to-square-final-2 To Square—a tutorial by the Summer Spot youths at the Lilla G. Frederick Pilot Middle School]
  −
* [http://www.youtube.com/watch?v=yHd6nEmXT34 A basic tutorial].
  −
* [http://www.dailymotion.com/user/sugarlabs/video/x9cpzd_turtleartportfoliobasics_creation a video of the portfolio basics]
  −
* [http://www.dailymotion.com/user/sugarlabs/video/x9dsjf_hotcold-game_creation Get your hot cold Turtle Art Video here!]
  −
* [http://www.dailymotion.com/user/sugarlabs/video/x9xz9o_stategame_tech Name that State!]
  −
* [http://www.dailymotion.com/video/xa7dle_shapes A Shapes and Colors Game]
  −
 
  −
{{:Activities/TurtleArt/Toolbars}}
  −
 
  −
===Keyboard shortcuts===
  −
* Ctrl+q quit (exit Turtle Art)
  −
* Alt+p show/hide the palettes
  −
* Alt+b show/hide the blocks
  −
* Alt+r run the 'start' stack rapidly
  −
* Alt+w run the 'start' stack slowly (and highlight blocks during execution)
  −
* Alt+s stop execution of the stack
  −
* Alt+e erase the screen
  −
* Esc return from full-screen mode
  −
* Ctrl+c copy a stack of blocks or text from a block
  −
* Ctrl+v paste a stack of blocks or text into a block
  −
* cursor (arrow) keys (or h j k l keys) move selected stack of blocks or turtle or move between toolbar items
  −
* Return (Enter) is used to run a stack of blocks or to select a toolbar item
  −
* space selects the next block (in the order in which they were added) (only in version 100+)
  −
 
  −
Note for OLPC-XO laptop users: the buttons on the display can also be used.
  −
* The left-hand buttons can be used to move a stack of blocks or turtle
  −
* o button runs the selected stack of blocks or returns the selected turtle to the home position (center of the screen)
  −
* × button deletes the selected stack of blocks
  −
* ✓ button runs the 'start' stack
  −
* ◽ button selects the next block (in the order in which they were added) (only in version 100+)
  −
 
  −
===Helpful hints===
  −
====Copying and Pasting====
  −
Did you know that you can copy/paste stacks to/from the clipboard? You type Ctrl-C to copy whatever stack is under the cursor to the clipboard. Ctrl-V will paste from the clipboard onto whatever TA project you have open. Try pasting this code into your Turtle Art project.
  −
 
  −
:[[0, "clean", 258, 217, [12, 1]], [1, "repeat", 258, 251, [0, 2, 3, null]], [2, ["number", 36], 309, 251, [1, null]], [3, "repeat", 323, 311, [1, 4, 5, 9]], [4,  ["number", 4], 374, 311, [3, null]], [5, "forward", 388, 371, [3, 6, 7]], [6, ["number", 300], 459, 371, [5, null]], [7, "right", 388, 413, [5, 8, null]], [8, ["number", 90], 446, 413, [7, null]], [9, ["vspace", 20], 323, 389, [3, 10]], [10, "right", 323, 463, [9, 11, null]], [11, ["number", 10], 381, 463, [10, null]], [12, "start", 258, 175, [null, 0]], [-1, ["turtle", 1], 0, 0, 0.0, 0, 50, 5]]
  −
 
  −
You can also paste text from the clipboard into text blocks.
  −
 
  −
Note: You can duplicate individual blocks with copy and paste, when duplicating a text block, deselect the text block after copying if you want to duplicate the block rather than duplicating the text within the block.
  −
 
  −
====Speed====
  −
Turtle Art has three 'run' buttons:
  −
* The 'rabbit' button will run your program at full screen. '''Note''': It will highlight blocks during execution, so your program will run much faster if you hide blocks.
  −
* The 'turtle' button will run your program with a slight delay between blocks. Block are highlighted as they are executed and block labels are updated with the current block values.
  −
* The 'debug' button will run your program with a longer delay between blocks. Block are highlighted as they are executed and block labels are updated with the current block values.
  −
 
  −
====Running Turtle Art outsde of Sugar====
  −
[[Image:TAGnome.png|300px]]
  −
 
  −
Turtle Art can be run in the GNOME desktop outside of Sugar.
  −
 
  −
PC HARDWARE:
  −
* Download [http://activities.sugarlabs.org/en-US/sugar/addon/4027 Turtle Art] (as a *.xo archive)
  −
* Extract the TurtleArt.activity directory from the archive, eg drag it to the desktop
  −
* Open directory TurtleArt.activity
  −
* Run turtleart.py (run in terminal is better, you can see error messages there)
  −
 
  −
OLPC XO HARDWARE
  −
* The XO1.5 and later software builds for the XO1.0 allow switching between Gnome and Sugar desktops. The following assumes that Turtle Art is already installed in Sugar.
  −
* Switch to the Gnome desktop
  −
* open olpc's home on the desktop
  −
* open Activities
  −
* on later software builds, Activities is both hidden and locked, if so, check show hidden files to unhide, in terminal chmod 777 Activities to unlock
  −
* open TurtleArt.activity
  −
* run turtleart.py (run in terminal is better, you can see error messages there)
  −
 
  −
== New features V83 and above==
  −
 
  −
<gallery>
  −
File:Coordinates.png|Cartesian and polar coordinate grids
  −
File:Collapsible.png|Collapsible stack
  −
File:Collapsed.png|Collapsed stack
  −
File:Python-expandable.png|Python function with one, two, or three variables
  −
File:Bullets-two.png|Expandable bullet list (two bullets)
  −
File:Bullets-four.png|Expandable bullet list (four bullets)
  −
File:Large-blocks.png|Enlarged blocks
  −
File:Small-blocks.png|Shrunken blocks
  −
File:100Turtles.png|100 Turtles
  −
File:TA-savesvg.svg|SVG output using the save SVG block
  −
File:TA-multivariable.png|Multi-variable Python blocks
  −
File:TAMaze.png|Turtle 'sees'
  −
</gallery>
  −
 
  −
{{:Activities/TurtleArt/Portfolios}}
  −
 
  −
==Sharing==
  −
 
  −
Turtle Art supports a simple sharing model. Whomever joins a shared activity will share turtles with the other participants, e.g., whatever any turtle draws will appear on every screen. (Please note that the "show" block is not shared, so it is not possible to share multimedia objects.) Share can consume a lot of network bandwidth, so it is not recommended to share among more than 2–3 people at a time. As with all Sugar activities, you can use the Share-with feature of the Journal to share your Turtle Art projects with others.
  −
 
  −
'''Note:''' as of Version 83, Turtle Art will not share correctly with older versions.
  −
 
  −
'''Note:''' as of Version 106, Turtle Art will share between Sugar and GNOME.
  −
 
  −
<gallery>
  −
File:TAsharingTurtles1.png|This (yellow) turtle drew a green star.
  −
File:TAsharingTurtles2.png|This (blue) turtle drew a blue square.
  −
File:TAsharingTurtles3.png|This (red) turtle drew a red circle.
  −
File:TAsharingvideo.png|A simple script to broadcast video by sharing.
  −
</gallery>
  −
 
  −
==Exporting to Berkeley Logo==
  −
Turtle Art can export its projects to [http://www.cs.berkeley.edu/~bh/ Berkeley Logo] (using either View Source or the Save as Logo button on the [[#Project Toolbar|Project Toolbar]])
  −
 
  −
<gallery>
  −
File:Taspin.png|A Turtle Art project
  −
File:UCB-Logo.png|The UCB Logo version (see "Internals" below)
  −
</gallery>
  −
<div class="visualClear"></div>
  −
 
  −
Logo code generated from your project is viewable in the View Source panel.
  −
<gallery>
  −
File:TA-to-square.png|Turtle Art code
  −
File:TA-view-source.png|View Source menu
  −
File:TA-view-logo-code.png|Logo code
  −
</gallery>
  −
 
  −
'''Note:''' The Save-as-Logo button saves to the Journal as "logosession.lg". UCB Logo does not yet access the Journal directly, so it is necessary to copy the project out of the Journal using the "copy-from-journal" command in the Terminal Activity and then accessing the project using the File menu within the UCB Logo Activity.
  −
 
  −
copy-from-journal logosession.lg
  −
 
  −
Alternatively, you can open the logosession in 'Write', copy the Logo code to the clipboard, and then paste it into the UCB Logo Activity.
  −
 
  −
===Internals, how a Turtle Art project is converted to Logo===
  −
Shown here is the Logo code generated from the Turtle Art project shown above.
  −
 
  −
Firstly the Logo code contains procedures for setting up the palette and the shade functionality:
  −
 
  −
to tasetpalette :i :r :g :b :myshade
  −
make "s ((:myshade - 50) / 50)
  −
ifelse lessp :s 0 [
  −
make "s (1 + (:s *0.8))
  −
make "r (:r * :s)
  −
make "g (:g * :s)
  −
make "b (:b * :s)
  −
] [
  −
make "s (:s * 0.9)
  −
make "r (:r + ((100-:r) * :s))
  −
make "g (:g + ((100-:g) * :s))
  −
make "b (:b + ((100-:b) * :s))
  −
]
  −
setpalette :i (list :r :g :b)
  −
end
  −
 
  −
to rgb :myi :mycolors :myshade
  −
make "myr first :mycolors
  −
make "mycolors butfirst :mycolors
  −
make "myg first :mycolors
  −
make "mycolors butfirst :mycolors
  −
make "myb first :mycolors
  −
make "mycolors butfirst :mycolors
  −
tasetpalette :myi :myr :myg :myb :myshade
  −
output :mycolors
  −
end
  −
 
  −
to processcolor :mycolors :myshade
  −
if emptyp :mycolors [stop]
  −
make "i :i + 1
  −
processcolor (rgb :i :mycolors :myshade) :myshade
  −
end
  −
 
  −
to tasetshade :shade
  −
make "myshade modulo :shade 200
  −
if greaterp :myshade 99 [make "myshade (199-:myshade)]
  −
make "i 7
  −
make "mycolors :colors
  −
processcolor :mycolors :myshade
  −
end
  −
 
  −
to tasetpencolor :c
  −
make "color modulo round :c 100
  −
setpencolor :color + 8
  −
end
  −
 
  −
make "colors [
  −
100 0 0 100 5 0 100 10 0 100 15 0 100 20 0 100 25 0 100 30 0 100 35 0 100 40 0 100 45 0
  −
100 50 0 100 55 0 100 60 0 100 65 0 100 70 0 100 75 0 100 80 0 100 85 0 100 90 0 100 95 0
  −
100 100 0 90 100 0 80 100 0 70 100 0 60 100 0 50 100 0 40 100 0 30 100 0 20 100 0 10 100 0
  −
0 100 0 0 100 5 0 100 10 0 100 15 0 100 20 0 100 25 0 100 30 0 100 35 0 100 40 0 100 45
  −
0 100 50 0 100 55 0 100 60 0 100 65 0 100 70 0 100 75 0 100 80 0 100 85 0 100 90 0 100 95
  −
0 100 100 0 95 100 0 90 100 0 85 100 0 80 100 0 75 100 0 70 100 0 65 100 0 60 100 0 55 100
  −
0 50 100 0 45 100 0 40 100 0 35 100 0 30 100 0 25 100 0 20 100 0 15 100 0 10 100 0 5 100
  −
0 0 100 5 0 100 10 0 100 15 0 100 20 0 100 25 0 100 30 0 100 35 0 100 40 0 100 45 0 100
  −
50 0 100 55 0 100 60 0 100 65 0 100 70 0 100 75 0 100 80 0 100 85 0 100 90 0 100 95 0 100
  −
100 0 100 100 0 90 100 0 80 100 0 70 100 0 60 100 0 50 100 0 40 100 0 30 100 0 20 100 0 10]
  −
make "shade 50
  −
tasetshade :shade
  −
 
  −
to tasetbackground :color :shade
  −
tasetshade :shade
  −
setbackground :color + 8
  −
end
  −
 
  −
Then the Logo code contains the project:
  −
 
  −
to ta
  −
clearscreen tasetbackground 21 100 setpensize 25.0 make "box1 0.0
  −
repeat 300.0 [ tasetpencolor xcor / 6.0 tasetshade heading forward :box1 right 91.0 make "box1 :box1 + 1.0 ]
  −
end
  −
 
  −
ta
  −
 
  −
==Looking under the hood==
  −
 
  −
Turtle Art projects are stored as a .ta file contains a [http://docs.python.org/library/json.html json-encoded] serialization of the project.
  −
 
  −
The json encoding of a repeat 4 forward 100 right 90 project:
  −
                                     
  −
[[0,"repeat",331,158,[null,1,2,null]],[1,["number","4"],417,167,[0,null]],[2,"forward",426,207,[0,3,4]],[3,["number","100"],500,216,[2,null]],[4,"right",426,246,[2,5,null]],[5,["number","90"],500,255,[4,null]],[-1,"turtle",0,0,0,0,50,5]]
  −
 
  −
The basic structure of the encoding is a list of lists, where each block has these elements:
  −
# block number
  −
# block name or [block name, block value]
  −
# x position (depreciated)
  −
# y position (depreciated)
  −
# list of connections to other blocks
  −
 
  −
Turtles are encoded at the end of the list:
  −
# -1
  −
# turtle or [turtle, turtle name]
  −
# x position
  −
# y position
  −
# heading
  −
# pen color
  −
# pen shade
  −
# pen width
  −
 
  −
==Programmable Brick==
  −
 
  −
The following feature—a block [[image:Pythoncodeblock.jpg |45px]] that can be programmed by the Pippy activity—is available in versions 44+ of Turtle Art.
  −
 
  −
===Version 44 to 103===
  −
A copy of the tamyblock.py module is stored in the Journal when you first launch Turtle Art. All the sample modules are in this one file but all except one are commented out with #
  −
 
  −
You can edit the tamyblock.py module in Pippy. Then load the Python code into the Python block using the Pippy button on the Project toolbar. [[Image:TAPippyButton.svg |30px]] You can only have one type of Python block in your Turtle Art program.
  −
 
  −
 
  −
[[Image:TA-pippy.png|300px]]
  −
 
  −
Another way to load the Python block, is to click the Python code block [[image:Pythoncodeblock.jpg |45px]] found on the the Extras palette.
  −
 
  −
===Version 104 onwards===
  −
There are two ways to create Python blocks: by loading sample code provided with Turtle Art or by loading Python code the your Journal.
  −
 
  −
====loading sample code====
  −
 
  −
A number of individual sample programs are provided. Clicking on the Load Python Block button on the Load/Save Toolbar [[File:Loadpythonsamples.jpg]] will invoke a file-selector dialog. Select the sample that you want and it will be both copied to the Journal and loaded into a Python block.
  −
 
  −
[[File:Pythonsampleselector.jpg]]
  −
 
  −
====loading code from the Journal====
  −
 
  −
Clicking on a Python block [[image:Pythoncodeblock.jpg |45px]] that has been dragged onto the canvas from the Extras palette will invoke an object-selector dialog.
  −
 
  −
[[File:Pythonobjectselector.jpg]]
  −
 
  −
Select the Python code that that you want and that code will be loaded into the selected block.
  −
 
  −
You can't run a Python block by clicking on it, as that opens the object selector; instead attach the block to another one and click elsewhere on the stack you have created.
  −
 
  −
Which ever way you create them, multiple Python blocks can have different code loaded in them.
  −
 
  −
===Sample code===
  −
 
  −
[[Image:TA-dotted-line.png]]
  −
 
  −
def myblock(lc, x):
  −
    ###########################################################################
  −
    #
  −
    # Draw a dotted line of length x.
  −
    #
  −
    ###########################################################################
  −
    try:  # make sure x is a number
  −
      x = float(x)
  −
    except ValueError:
  −
        return
  −
    if lc.tw.canvas.pendown:
  −
        dist = 0
  −
        while dist+lc.tw.canvas.pensize < x:  # repeat drawing dots
  −
            lc.tw.canvas.setpen(True)
  −
            lc.tw.canvas.forward(1)
  −
            lc.tw.canvas.setpen(False)
  −
            lc.tw.canvas.forward((lc.tw.canvas.pensize*2)-1)
  −
            dist += (lc.tw.canvas.pensize*2)
  −
        lc.tw.canvas.forward(x-dist)          # make sure we have moved exactly x
  −
        lc.tw.canvas.setpen(True)
  −
    else:
  −
        lc.tw.canvas.forward(x)
  −
    return
  −
 
  −
You can pass a list of up to three arguments to tamyblock.py as in the example below that converts the input to an rgb value.
  −
 
  −
[[Image:TA-rgb.png]]
  −
 
  −
def myblock(lc, x):
  −
    ###########################################################################
  −
    #
  −
    # Set rgb color
  −
    #
  −
    ###########################################################################
  −
    r = int(x[0])
  −
    while r < 0:
  −
        r += 256
  −
    while r > 255:
  −
        r -= 256
  −
    g = int(x[1])
  −
    while g < 0:
  −
        g += 256
  −
    while g > 255:
  −
        g -= 256
  −
    b = int(x[0])
  −
    while b < 0:
  −
        b += 256
  −
    while b > 255:
  −
        b -= 256
  −
    rgb = "#%02x%02x%02x" % (r,g,b)
  −
    lc.tw.fgcolor = lc.tw.canvas.cm.alloc_color(rgb)
  −
    return
  −
 
  −
def myblock(lc, x):
  −
    ###########################################################################
  −
    #
  −
    # Push an uppercase version of a string onto the heap.
  −
    # Use a 'pop' block to use the new string.
  −
    #
  −
    ###########################################################################
  −
    if type(x) != str:
  −
        X = str(x).upper()
  −
    else:
  −
        X = x.upper()
  −
    lc.heap.append(X)
  −
    return
  −
 
  −
def myblock(lc, x):
  −
    ###########################################################################
  −
    #
  −
    # Push hours, minutes, seconds onto the FILO.
  −
    # Use three 'pop' blocks to retrieve these values.
  −
    # Note: because we use a FILO (first in, last out heap),
  −
    # the first value you will pop will be seconds.
  −
    #
  −
    ###########################################################################
  −
    lc.heap.append(localtime().tm_hour)
  −
    lc.heap.append(localtime().tm_min)
  −
    lc.heap.append(localtime().tm_sec)
  −
    return
  −
 
  −
def myblock(lc, x):
  −
    ###########################################################################
  −
    #
  −
    # Add a third dimension (gray) to the color model.
  −
    #
  −
    ###########################################################################
  −
    val = 0.3 * lc.tw.rgb[0] + 0.6 * lc.tw.rgb[1] + 0.1 * lc.tw.rgb[2]
  −
    if x != 100:
  −
        x = int(x)%100
  −
    r = int((val*(100-x) + lc.tw.rgb[0]*x)/100)
  −
    g = int((val*(100-x) + lc.tw.rgb[1]*x)/100)
  −
    b = int((val*(100-x) + lc.tw.rgb[2]*x)/100)
  −
    # reallocate current color
  −
    rgb = "#%02x%02x%02x" % (r,g,b)
  −
    lc.tw.fgcolor = lc.tw.canvas.cm.alloc_color(rgb)
  −
    return
  −
 
  −
def myblock(lc, x):
  −
    ###########################################################################
  −
    #
  −
    # Save an image named x to the Sugar Journal.
  −
    #
  −
    ###########################################################################
  −
    lc.tw.save_as_image(str(x))
  −
    return
  −
 
  −
def myblock(lc, x):
  −
 
  −
    ###########################################################################
  −
    #
  −
    # Push mouse event to stack
  −
    #
  −
    ###########################################################################
  −
 
  −
    if lc.tw.mouse_flag == 1:
  −
        # push y first so x will be popped first
  −
        lc.heap.append((lc.tw.canvas.height / 2) - lc.tw.mouse_y)
  −
        lc.heap.append(lc.tw.mouse_x - (lc.tw.canvas.width / 2))
  −
        lc.heap.append(1) # mouse event
  −
        lc.tw.mouse_flag = 0
  −
    else:
  −
        lc.heap.append(0) # no mouse event
  −
 
  −
===Understanding the structure of the Turtle Art program===
  −
Turtle Art offers two blocks for adding Python code,
  −
* the Python function block [[image:Pythonfunctionblock.jpg]] adds a single line of code,
  −
* the Python code block [[image:Pythoncodeblock.jpg]] supports multi-line code.
  −
 
  −
====Python function block====
  −
The Python function block is processed through tajail.py. For security reasons, it cannot access Turtle Art objects. It can it only access the Python language and the time and math libraries as the following extract from tajail.py shows.
  −
 
  −
from time import *
  −
from math import *
  −
 
  −
For more information on allowable syntax for this block:
  −
* Python language, see http://docs.python.org/tutorial/
  −
* math library, see http://docs.python.org/library/math.html
  −
* time library, see http://docs.python.org/library/time.html
  −
* <strike>Numpy library, see numpy.scipy.org/</strike> (Not supported as of v104)
  −
 
  −
====Python code block====
  −
Turtle Art is created in object oriented Python code. This is based around the definition of classes and the creation of object(s) which are instance(s) of that class. These objects then have properties and methods which are defined by their class.
  −
 
  −
See http://docs.python.org/tutorial/classes.html for a description of classes in Python.
  −
 
  −
See the file TurtleArtActivity.py. This is where it starts. When an instance of TurtleArtActivity is created, setup_canvas() creates an instance of TurtleArtWindow: self.tw This instance of TurtleArtWindow creates an instance of  LogoCode: self.tw.lc and an instance of TurtleGraphics: self.tw.canvas
  −
 
  −
tamyblock.py gets passed a LogoCode instance, lc, and everything is relative to that instance.  tw is passed to lc and set as an instance data object at init. This allows referral back to tw when needed. Consequently, Class TurtleArtWindow is accessed through lc.tw. and Class TurtleGraphics is accessed through lc.tw.canvas
  −
 
  −
 
  −
{| border=1 cellpadding=3 cellspacing=3 style="margin: 1em auto 1em auto; border: 1px #666666 solid; border-collapse: collapse; background: #f9f9f9;"
  −
!Class!!Defined in!!Instance!!Created in
  −
|-
  −
|TurtleArtActivity||TurtleArtActivity.py|| ||inherits from sugar.activity
  −
|-
  −
|TurtleArtWindow||tawindow.py||tw||TurtleArtActivity.py
  −
|-
  −
|LogoCode||talogo.py||lc||tawindow.py
  −
|-
  −
|TurtleGraphics||tacanvas.py||canvas||tawindow.py
  −
|-
  −
|Turtles, Turtle||taturtle.py||turtles||tawindow.py, tacanvas.py
  −
|-
  −
|Blocks, Block||tablock.py||block_list||tawindow.py
  −
|}
  −
 
  −
Class TurtleArtWindow – useful properties and methods (from within tamyblock.py, lc.tw is the class instance)
  −
{| border=1 cellpadding=3 cellspacing=3 style="margin: 1em auto 1em auto; border: 1px #666666 solid; border-collapse: collapse; background: #f9f9f9;"
  −
!Methods and data attributes!!Example!!Notes
  −
|-
  −
|set_fullscreen(self)||lc.tw.set_fullscreen()||Hides the Sugar toolbar
  −
|-
  −
|set_cartesian(self, flag)||lc.tw.set_cartesian(True)||True will make the overlay visible; False will make it invisible
  −
|-
  −
|set_polar(self, flag)||lc.tw.set_polar(True)||True will make the overlay visible; False will make it invisible
  −
|-
  −
|hideshow_button(self, flag)||lc.tw.hideshow_button()||Toggles visibility of blocks and palettes
  −
|-
  −
|self.active_turtle||lc.tw.active_turtle||The active turtle instance
  −
|}
  −
 
  −
Class TurtleGraphics – useful properties and methods (from within tamyblock.py, lc.tw.canvas is the class instance)
  −
{| border=1 cellpadding=3 cellspacing=3 style="margin: 1em auto 1em auto; border: 1px #666666 solid; border-collapse: collapse; background: #f9f9f9;"
  −
!Methods and data attributes!!Example!!Notes
  −
|-
  −
|clearscreen(self)||lc.tw.canvas.clearscreen()||Clears the screen and resets all turtle and pen attributes to default values
  −
|-
  −
|setpen(self, flag)||lc.tw.canvas.setpen(True)||True will set the pen "down", enabling drawing; False will set the pen "up"
  −
|-
  −
|forward(self, n)||lc.tw.canvas.forward(100)||Move the turtle forward 100 units
  −
|-
  −
|arc(self, a, r)||lc.tw.canvas.arc(120, 50)||Move the turtle along an arc of 120 degrees (clockwise) and radius of 50 units
  −
|-
  −
|setheading(self, a)||lc.tw.canvas.setheading(180)||Set the turtle heading to 180 (towards the bottom of the screen)
  −
|-
  −
|self.heading||lc.tw.canvas.heading||The current heading
  −
|-
  −
|setpensize(self, n)||lc.tw.canvas.setpensize(25)||Set the turtle pensize to 25 units
  −
|-
  −
|self.pensize||lc.tw.canvas.pensize||The current pensize
  −
|-
  −
|setcolor(self, c)||lc.tw.canvas.color(70)||Set the pen color to 70 (blue)
  −
|-
  −
|self.color||lc.tw.canvas.color||The current pen color
  −
|-
  −
|setshade(self, s)||lc.tw.canvas.shade(50)||Set the pen shade to 50
  −
|-
  −
|self.shade||lc.tw.canvas.shade||The current pen shade
  −
|-
  −
|fillscreen(self, c, s)||lc.tw.canvas.fillscreen(70, 90)||Fill the screen with color 70, shade 90 (light blue)
  −
|-
  −
|setxy(self, x, y)||lc.tw.canvas.setxy(100,100)||Move the turtle to position (100, 100)
  −
|-
  −
|self.xcor||lc.tw.canvas.xcor||The current x coordinate of the turtle (scaled to current units)
  −
|-
  −
|self.ycor||lc.tw.canvas.ycor||The current y coordinate of the turtle (scaled to current units)
  −
|-
  −
|self.set_turtle(name)||lc.tw.canvas.set_turtle(1)||Set the current turtle to turtle '1'
  −
|}
  −
 
  −
Other useful Python functions
  −
{| border=1 cellpadding=3 cellspacing=3 style="margin: 1em auto 1em auto; border: 1px #666666 solid; border-collapse: collapse; background: #f9f9f9;"
  −
!Module!!Methods and data attributes!!Example!!Notes
  −
|-
  −
|from math import pow||pow(2,3)||returns 2 to the 3rd power (8)||See http://docs.python.org/library/math.html
  −
|-
  −
|from math import sin, pi||sin(45*pi/180)||returns sin of 45 (0.707)||See http://docs.python.org/library/math.html
  −
|-
  −
|from time import localtime||localtime().tm_hour||returns the current hour||See http://docs.python.org/library/time.html
  −
|-
  −
| ||lc.heap.append(data)||add data to the FILO||See http://docs.python.org/tutorial/datastructures.html
  −
|-
  −
| ||data = lc.heap.pop(-1)||pop data off of the FILO||See http://docs.python.org/tutorial/datastructures.html
  −
|}
  −
 
  −
==From the field==
  −
 
  −
Tony Forster has written a number of blog posts about his experiments with Turtle Art:
  −
* [http://tonyforster.blogspot.com/2009/02/using-python-blocks-in-turtleart.html Using Python blocks in TurtleArt]
  −
* [http://tonyforster.blogspot.com/2009/02/turtle-lander.html Turtle Lander]
  −
* [http://tonyforster.blogspot.com/2009/01/reprogramming-sugar.html Reprogramming Sugar]
  −
* [http://tonyforster.blogspot.com/2009/12/turtle-random.html Turtle random] [[File:Turtle Blocks Activity random.ta]] (English & español)
  −
* [http://tonyforster.blogspot.com/2009/12/turtle-random-v2.html Turtle random V2]    [[File:Turtle Blocks Activity randomv3.ta]]  (English & español)
  −
* [http://tonyforster.blogspot.com/2009/12/turtle-lissajous.html Turtle Lissajous] [[File:Turtle_Art_lisajous.ta‎]] (English & español)
  −
* [http://tonyforster.blogspot.com/2009/12/turtle-spring-damper.html Turtle spring damper] [[File:Turtle_spring_damper.ta‎]]      (English & español)
  −
* [http://tonyforster.blogspot.com/2009/09/turtle-art-color-and-shade.html color and shade]
  −
* [http://tonyforster.blogspot.com/2009/09/turtleart-shapes.html Turtle Art shapes]
  −
* [http://tonyforster.blogspot.com/2009/12/bouncing-turtle.html Bouncing Turtle] [[File:TurtleArt_bounce.ta‎]]
  −
* [http://tonyforster.blogspot.com/2009/12/turtle-pythagoras.html Turtle Pythagoras 1], [http://tonyforster.blogspot.com/2010/02/turtle-pythagoras.html 2]
  −
* [http://tonyforster.blogspot.com/2009/12/turtle-graph.html Turtle graph] [[File:Turtle_graph.ta‎ ]]
  −
* [http://tonyforster.blogspot.com/2009/12/turtle-pi.html Turtle Pi] [[File:Turtle_pi.ta]]    (English & español)
  −
* [http://tonyforster.blogspot.com/2010/10/turtle-pi-another-one.html Turtle Pi, another one] [[File:Turtle Blocks pi another.ta]] (English & español) 
  −
* [http://tonyforster.blogspot.com/2009/12/turtle-fractions.html Turtle fractions] [[File:TmpBtvKZX.ta‎]]        (English & español)
  −
* [http://tonyforster.blogspot.com/2009/12/turtle-interactive-multimedia.html Turtle interactive multimedia]
  −
* [http://tonyforster.blogspot.com/2010/02/turtle-art-collapsed-stacks-and-numeric.html capture numeric input] [[File:Turtle_Art_getnumber.ta‎ ]]  (English & español)
  −
* [http://tonyforster.blogspot.com/2010/02/turtle-e.html Turtle e][[File:Turtle_e.ta‎]]        (English & español)
  −
* [http://tonyforster.blogspot.com/2010/03/turtle-spirograph.html Turtle spirograph] [[File:Turtle_Art_spirograph.ta‎]]          (English & español)
  −
* [http://tonyforster.blogspot.com/2010/03/mouse-support-in-turtleart.html Mouse support] [[File:Turtle_Art_Activity_mouse.ta‎]]
  −
* [http://tonyforster.blogspot.com/2010/03/turtle-sieve-of-eratosthenes.html Turtle-sieve-of-Eratosthenes] [[File: Turtle_Art_Activity_eratos.ta‎ ]]  (English & español)
  −
* [http://tonyforster.blogspot.com/2010/09/turtle-sliderule.html Turtle sliderule]
  −
* [http://tonyforster.blogspot.com/2010/09/turtle-diophantine.html Turtle Diophantine] [[File:Turtle Blocks Activity Diophantine.ta]], [http://wiki.laptop.org/go/Aplicacion_Problema_de_Pizzas#TortugArte see also]    (English & español)
  −
* [http://tonyforster.blogspot.com/2010/11/turtle-paint.html Turtle Paint]  [[File:Turtle Blocks Activity paint.doc]]
  −
* [http://tonyforster.blogspot.com/2010/12/turtle-art-music-keyboard.html Turtle Music Keyboard]  [[File:Turtle Art Activity keyboard.doc]] (English & español)
  −
* [http://tonyforster.blogspot.com/2011/02/turtle-art-text-to-speech.html Text to speech]
  −
 
  −
An bringing it all together, [http://tonyforster.blogspot.com/2009/03/turtle-oscilloscope.html the Turtle Art Oscilloscope].
  −
 
  −
[http://tonyforster.blogspot.com/2009/03/turtle-oscilloscope.html http://3.bp.blogspot.com/_fTmGyLerUL4/Sbyd3ClYTJI/AAAAAAAAARs/21Q1ERocXzE/s400/Untitled.jpg]
  −
 
  −
Tony has also used the programmable block to do [http://tonyforster.blogspot.com/2009/03/turtle-fileview.html file IO].
  −
 
  −
 
  −
===Turtle Art Arduino===
  −
Andrés Aguirre is part of the Butiá team in Montevideo:
  −
:We have released the 1.0 version of the sources, which has full integration with tortugarte (http://www.fing.edu.uy/inco/proyectos/butia/publicaciones.html). Last month we gave away nearly 30 Butiá robots in a robotic event organized by the University. These robots were given to secondary schools throughout the country, in this event we gave some tutorials and exercises to do with our help. One of the schools made a great line follower in tortugarte ;) : http://www.youtube.com/watch?v=Szp0LWLyPIg Then on the second day we give some tutorials and some children really enjoyed the experience, like Pedro a 10 year old child who really has programming skills! http://www.flickr.com/photos/butiarobot/5059177334/ http://www.youtube.com/aguirrea#p/u/7/p0y11iyhFko
  −
:In future months we will go to the schools where we give the robots to continue teaching and giving new challenges. If you would like to see more about Butiá, we have a flickr site: http://www.flickr.com/photos/butiarobot/ and also a web page: http://www.fing.edu.uy/inco/proyectos/butia
  −
 
  −
* [http://tonyforster.blogspot.com/2010/10/arduino-fork-of-turtle-art.html Setting up Turtle Arduino]
  −
* [http://tonyforster.blogspot.com/2010/10/turtle-arduino-display-inputs.html Read digital inputs] [[File:Ard.ta]]
  −
* [http://tonyforster.blogspot.com/2010/10/turtle-arduino-digital-write.html Arduino write output] [[File:Turtle Art Activity ardout.ta]] [[File:Tamyblock mouse.odt]]
  −
 
  −
== Modifying Turtle Art ==
  −
 
  −
Turtle Art is under the MIT license. You are free to use it and learn with it. You are also encourage to modify it to suit your needs or just for a further opportunity to learn.
  −
 
  −
Much of the motivation behind the Version 83 refactoring of the code was to make it easier for you to make changes. Most changes can be confined to two modules: taconstants.py and talogo.py. The former defines the blocks and palettes; the latter defines what code is executed by a block.
  −
 
  −
'''Note:''' As of Version 106, there is also support for plugins. If you can use the plugin mechanism to add support for additional devices, e.g., Arduino, or for making modifications such as are described below without making changes to the standard code base. (The advantage to the latter is that your changes will remain intact even after you upgrade to a newer version.)
  −
 
  −
taconstants.py contains the constants that by-in-large determine the behavior of Turtle Art. Notably, the block palettes are defined below. If you want to add a new block to Turtle Art, it is generally a matter of modifying some tables below and then adding the primitive to talogo.py. For example, if we want to add a new turtle command, 'uturn', we'd make the following changes:
  −
 
  −
(1) We'd add 'uturn' to the PALETTES list of lists:
  −
 
  −
PALETTES = [['forward', 'back', 'clean', 'left', 'right', 'show',
  −
              'seth', 'setxy', 'heading', 'xcor', 'ycor', 'setscale',
  −
              'arc', 'scale', 'left', 'top', 'right', 'bottom', 'uturn'],
  −
            ['penup','pendown', 'setpensize', 'fillscreen', 'pensize',...
  −
 
  −
(2) Then we'd add it to one of the block-style definitions. Since it takes
  −
no arguments, we'd add it here:
  −
 
  −
BASIC_STYLE = ['clean', 'penup', 'pendown', 'stack1', 'stack2', 'vspace',
  −
    'hideblocks', 'showblocks', 'clearheap', 'printheap', 'kbinput', 'uturn']
  −
 
  −
(3) Then we give it a name (Note the syntax _('string to be
  −
translated') used by the language-internationalization system; also
  −
note that the name is an array, as some blocks contain multiple
  −
strings.):
  −
 
  −
BLOCK_NAMES = {
  −
...
  −
    'uturn':[_('u-turn')],
  −
...
  −
              }
  −
 
  −
(4) and a help-menu entry:
  −
 
  −
HELP_STRINGS = {
  −
...
  −
    'uturn':_('change the heading of the turtle 180 degrees'),
  −
...
  −
              }
  −
 
  −
(5) Next, we need to define it as a primitive for the Logo command
  −
parser (generally just the same name):
  −
 
  −
PRIMITIVES = {
  −
...
  −
    'uturn':'uturn',
  −
...
  −
            }
  −
 
  −
(6) Since there are no default arguments, we don't need to do anything
  −
else here. But we do need to define the actual function in talogo.py
  −
 
  −
DEFPRIM = {
  −
...
  −
    'uturn':[0, lambda self: self.tw.canvas.seth(self.tw.canvas.heading+180)],
  −
...
  −
          }
  −
 
  −
That's it. When you next run Turtle Art, you will have a 'uturn' block
  −
on the Turtle Palette.
  −
 
  −
[[Image:TAuturn.png|300px]]
  −
 
  −
Adding a new palette is simply a matter of: (1) adding an additional entry to PALETTE_NAMES; (2) new list of blocks to PALETTES; and (3) an additional entry in COLORS. However you will have to: (4) create icons for the palette-selector buttons. These are kept in the icons subdirectory. You need two icons: yourpalettenameoff.svg and yourpalettenameon.svg, where yourpalettename is the same string as the entry you added to the PALETTE_NAMES list. Note that the icons should be the same size (55x55) as the others. This is the default icon size for Sugar toolbars.
  −
 
  −
==Just for fun==
  −
<gallery>
  −
File:Galapagos.png|my elder cousin
  −
File:Hot-cold.png|[http://www.dailymotion.com/user/sugarlabs/video/x9dsjf_hotcold-game_creation (video)]
  −
File:State-game.png|[http://www.dailymotion.com/user/sugarlabs/video/x9xz9o_stategame_tech (video)]
  −
File:Pie1.png
  −
File:Pie2.png|[http://5toescuela3.blogspot.com/2009/07/actividades-para-sugar.html Using Turtle Art for pie charts]
  −
File:Keyboard.png|Q: How do I cast keyboard input to a string? Looking at the source your are using ord() to fetch the input... is there a way to convert that back to string before showing it? ANS: Use chr(). See the example in the illustration.
  −
File:Explicit_approach.png
  −
File:Approximation_approach.png
  −
File:100_turtles.png
  −
File:RFID.png
  −
File:TurtleTrees.png
  −
</gallery>
 

Navigation menu