Changes

Jump to navigation Jump to search
m
no edit summary
Line 1: Line 1:  
==About Turtle Art==
 
==About Turtle Art==
   −
[[File:Activity-Turtle Art.svg]]
+
[[File:Activity-Turtle Art.png]]
    
Turtle Art, also known as 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, graphics, mathematics, and Computer Science features which will challenge the more adventurous student.
 
Turtle Art, also known as 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, graphics, mathematics, and Computer Science features which will challenge the more adventurous student.
Line 13: Line 13:  
==Using Turtle Art==
 
==Using Turtle Art==
   −
[[Image:300px-Screenshot of 'Turtle Art Activity' getting started.png|300px]]
+
[[Image:Screenshot of "Turtle Art Activity" getting started.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 66: Line 66:  
File:Mathoperators.jpg |Math operators including + - * / mod sqrt
 
File:Mathoperators.jpg |Math operators including + - * / mod sqrt
 
File:TA-if.png|Logical operations: flow control blocks accept >, <, =, and, not, or as input  
 
File:TA-if.png|Logical operations: flow control blocks accept >, <, =, and, not, or as input  
File:Pie2.png|Make pie charts [http://wiki.sugarlabs.org/go/File:Turtle_Art_Activity_pie_chart.ta]
+
File:Pie2.png|Make pie charts [[File:Turtle_Art_Activity_pie_chart.ta]]
 
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: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:Coordinates.png|Cartesian and polar coordinate grids
 
File:Coordinates.png|Cartesian and polar coordinate grids
Line 76: Line 76:  
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|Entering a multi digit number, exits with the number in 'box 1', [[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', [[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 [[Activities/Turtle Art/Using_Turtle_Art_Sensors]]
 
</gallery>
 
</gallery>
===The Toolbars===
+
{{:Activities/Turtle Art/Toolbars}}
 
  −
 
  −
===<Activity-specific descriptions>===
      
==Learning with Turtle Art==
 
==Learning with Turtle Art==
   −
[http://www.blogger.com/profile/03384288304778972289 Tony Forster] and [http://wiki.sugarlabs.org/go/User:Mokurai Mokurai] have created a number of [http://wiki.sugarlabs.org/go/Activities/TurtleArt/Tutorials Turtle Art Tutorials] on a wide range of math, programming, art, and Computer Science topics. There is also a substantial literature of educational materials using the Logo programming language, from which Turtle Art and Turtle Blocks derive. The Exploring with Logo series from MIT Press is particularly recommended for showing how far beyond simple graphics Logo can go. Mokurai recommends starting with his first three, specifically designed for helping beginners of all ages, starting with the preliterate in preschool.
+
[http://www.blogger.com/profile/03384288304778972289 Tony Forster] and [[User:Mokurai]] have created a number of [[Activities/Turtle Art/Tutorials Turtle Art Tutorials]] on a wide range of math, programming, art, and Computer Science topics. There is also a substantial literature of educational materials using the Logo programming language, from which Turtle Art and Turtle Blocks derive. The Exploring with Logo series from MIT Press is particularly recommended for showing how far beyond simple graphics Logo can go. Mokurai recommends starting with his first three, specifically designed for helping beginners of all ages, starting with the preliterate in preschool.
   −
* [http://wiki.sugarlabs.org/go/Activities/TurtleArt/Tutorials/You_be_the_Turtle You be the Turtle] without the computer.
+
* [[Activities/Turtle Art/Tutorials/You_be_the_Turtle|You be the Turtle]] without the computer.
* [http://wiki.sugarlabs.org/go/Activities/TurtleArt/Tutorials/Mathematics_and_art Mathematics and art], an introduction to TA.
+
* [[Activities/Turtle Art/Tutorials/Mathematics_and_art|Mathematics and art]], an introduction to TA.
* [http://wiki.sugarlabs.org/go/Activities/TurtleArt/Tutorials/Counting Counting]
+
* [[Activities/Turtle Art/Tutorials/Counting|Counting]]
    
==Extending Turtle Art==
 
==Extending Turtle Art==
Line 143: Line 140:  
==Modifying Turtle Art==
 
==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.)
 +
 +
The tabasics.py file 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, you could simply add a block of code to that file or to turtle_block_plugin.py,
 +
which contains additional blocks. (Even better, write your own plugin!!)
 +
 +
Adding a new palette is simply a matter of:
 +
    palette = make_palette('mypalette',  # the name of your palette
 +
                          colors=["#00FF00", "#00A000"],
 +
                          help_string=_('Palette of my custom commands'))
 +
 +
For example, if we want to add a new turtle command, 'uturn', we'd use the
 +
add_block method in the Palette class.
 +
    palette.add_block('uturn',  # the name of your block
 +
                      style='basic-style',  # the block style
 +
                      label=_('u turn'),  # the label for the block
 +
                      prim_name='uturn',  # code reference (see below)
 +
                      help_string=_('turns the turtle 180 degrees'))
 +
 +
Next, you need to define what your block will do. def_prim takes 3 arguments: the primitive name, the number of arguments—0 in this case—and the function to call—in this case, the canvas.seth function to set the heading.
 +
 +
    self.tw.lc.def_prim('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 'mypalette' palette.
 +
 +
You will have to create icons for the palette-selector buttons. These
 +
are kept in the icons subdirectory. You need two icons:
 +
mypaletteoff.svg and mypaletteon.svg, where 'mypalette' is the same
 +
string as the entry you used in instantiating the Palette class. Note
 +
that the icons should be the same size (55x55) as the others. (This is
 +
the default icon size for Sugar toolbars.)
    
==Where to report problems==
 
==Where to report problems==
    +
Please file bug reports [https://bugs.sugarlabs.org/newticket?component=Turtleart here].
    
==Credits==
 
==Credits==
   −
Turtle Art and Turtle Blocks were created and are maintained by Walter Bender.
+
* Walter Bender and Raúl Gutiérrez Segalés maintain the code (with some occasional help from Simon Schampijer)
 +
* Alan Jhonn Aguiar Schwyn and the Butia Team have provided great feedback and many patches.
 +
* Especially helpful feedback from Tony Forster, Guzmán Trinidad, and Bill Kerr
 +
* Brian Silverman is the first author of Turtle Art

Navigation menu