AutoHotkey | Android | Arduino | COMM140 | Fractals | Grammar Checkers | Knots | A Million Dots Activity | Processing | Processing for Scratch Users | Redbubble | Tutorials | Weather | World Time Meeting Planner | Favicon Generator.
Home > MicroWorlds Logo (Turtle Graphics) Links & Examples > Examples >Turtle Graphics Examples
The following programs are a collection of examples most of which I have created
for my own amusement or as
teaching aids. You are welcome to download copies and play with them. You may
also place copies on your website as long as you add a link to this page and
e-mail me details of where you are using them.
If you switch to the procedures page using Ctrl + F or Pages | Procedures you
will see that most of these examples use procedures. if the example has no procedures
then right click on the turtle and see if there is any code programmed directly
into the turtle.
Colours can also have code associated with them. Click on the Paint Brush button
to view the colour pallet.
any colours with a black dot in the center of the colour has logo code programmed
into it. Double click on the colour to view the associated code.Note: these
example programs are written using MicroWorlds Version 2.05
The Following MicroWorlds programs are free software;
you can redistribute and/or modify them under the terms of the GNU
General Public License as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
These programs are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU
General Public License |
random-lines.mw2 428
KB |
In this example each turtle is programmed directly. Simple programs like this do not require writing procedures. This is an interesting example as it produces images that
have a fractal nature not unlike the worl of Jackson
Pollock. see: Fractal
Expressionism |
house&sun.mw2 30
KB |
Draws a house with a sunrise |
fun3.mw2 94 KB |
An example of using
sliders to change variables |
A example of using the random function chaos.mw2 229 KB |
to
filler_t to lines_t |
Draws a torus consisting of 180 circles. |
|
poster1.zip 30KB use winzip to unzip |
to
fun3 :rep :step :deg snapshot ; takes a picture of the screen ; use restore to restore the ; screen to the snapshot version pd repeat :rep [lt :deg fd :step rt :deg fd :step rt 360 / :rep] end |
dothing.zip 10KB use winzip to unzip |
Just a thing. This example uses sliders to pass values to a procedure. |
example1.zip 5 KB use winzip to unzip example1.mw2 62 KB |
A collection of examples to use when introducing MicroWorlds |
polyspiral.zip 7KB use winzip to unzip |
A Polyspiral |
squares.zip 7KB use winzip to unzip |
Squares Original idea from: to square :size
;
draw a square with sides to go :number_of_times :size make "size :size +
2 ; make the size of
:size 2 step bigger |
An example of playing with drawing "brushes"
|
|
target.zip 5KB use winzip to unzip |
to target ; ----- Note the values for the angles
eg cg to concentric :size :angle :colour Draws a series of concentric circles each filled with colour |
circles4.zip 4KB use winzip to unzip |
To reproduce the type of patterns created by "Electro Lights" #02820 Produced by Maui Toys www.MauiToys.com made in China ;Note this is still a work in progress. |
etch-a-sketch2.zip 4KB use winzip to unzip |
Etch-a-sketch a work in progress |
circles1.zip 8KB use winzip to unzip |
Inspired by the online essay going
in circles http://llk.media.mit.edu/projects/circles/ |
circles2.zip 4KB use winzip to unzip |
Note this version of circles1.zip uses: talkto [t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14
t15 t16 t17 t18 t19 t20 t21 t22 t23 t24 t25 t26 t27 t28 t29 t30 t31 t32
t33 t34 t35 t36] instead of: everyone [repeat 30 [fd 4]] because each turtle moves forward at the same time. Using everyone [repeat 30 [fd 4]] moves each turtle one after the other which spoils the effect. Inspired by the online essay going
in circles |
lost_in_the_desert.zip 4KB use winzip to unzip |
Inspired by the online essay going
in circles |
one_good_turn.mw2
27 KB |
Demonstrates the use of radio buttons Inspired by the online essay going
in circles |
on_a_tangent.zip 9KB use winzip to unzip |
Inspired by the online essay
going in circles |
ring-around-a-rosie.zip 5KB use winzip to unzip |
Inspired by the online essay
going in circles |
harmonic.zip 5KB use winzip to unzip |
Inspired by the online essay
going in circles |
cornered.zip 5KB use winzip to unzip |
Inspired by the online essay
going in circles |
spiral.zip 4KB use winzip to unzip |
to
spiral Draws a nice spiral and some weird variations as well. |
star-moon-star.zip 61KB use winzip to unzip
|
A similar program to random_tri_sq.zip |
random_tri_sq.zip 38KB use winzip to unzip |
Draws random triangles & squares, Produces nice 50's style table top designs. Demonstrates one way to implement push button controls using turtles. to click_switch if :click_switch = "true [ to check_switches
|
make_turtles.mw2 52 KB make_turtles.zip 10 KB use winzip to unzip |
Make and remove turtles using procedures based on code from: http://www.microworlds.com/library/math/geoboard/geoboard.zip to remove_all_turtles newturtle "create_a_dummy_turtle
; this is necessary make "number_of_turtles count
get first pagelist "turtles |
headings.mw2 75 KB headings.zip 15 KB use winzip to unzip |
The heading names were created using Paint
Shop Pro. |
August 16, 2004 |
to play1 |
September 4, 2004 triangles1.mw2 22
KB
Plugin version
|
Draws sets of triangles. Uses simple checkboxes to toggle between B/W & colour triangles and Automaitc or Manual positioning of turtles. |
spirals2.mw2 61 KB |
to spiral :size :angle |
art2.mw2 33KB art2 source code
Plugin version See Art1 above |
|
spirals3.mw2 135
KB spirals3 source code
Plugin version see: spirals2 above based on code from: A
Logo Primer http://el.media.mit.edu/logo-foundation/logo/turtle.html |
to
curve :size deg ; this is the heart of the program pd ifelse (and ((first pos) < 200 ) ((last pos) < 200) ) [ fd :size rt :deg make "size :size + 0.3 curve :size deg ; recursive call ][pu fd 2 setc "yellow fill ht stop] ; recursive stop end |
move_turtle1.mw2 29 KB |
to startup make "step 50 make "line_size 1 move_turtle end to move_turtle if :ch = 38 [t1, seth 0 fd :step] ;
north ; < or , reduce step size
; > or . increase step size ; x or X increase pensize ; z or Z decreade pensize setpensize :line_size setc (random 15) + 125 ; add
some colour |
move_turtle2.mw2 29 KB
|
Move the turtle using the
cursor keys Yet another more complex version of move_turtle0 This is an example of creeping featurisim. I could not help adding the ability to lift the turtle using U for pu and then I had to have D for pd and then I had to be able to see the diffierence between when the turtle was up and down. And then I added colours and then I though what about white... This is always a risk when writing programs. Creeping featurisim is also known as program bloat. |
October 21, 2004 move_turtle3.mw2
82 KB move_turtle3 source
code
|
Another more complex version of move_turtle0 This version uses features from Art2 to colour the turtle as it moves |
move_turtle0.mw2
18 KB move_turtle0 source
code |
Move the turtle using the cursor keys to startup |
Draws harmonographs
Based on code from http://www.mulawa.net/mulawa/projects/index.html Andrew Purdam has produced equations that allow one to
explore the beauty of the harmongraph without building one....not that
building one is any less satisfying. His equations are: y(t) = Ay(t) sin(wy + py) All initial amplitudes, frequencies (w) and phases (p) should be different and not integer multiples for the most complicated (interesting) patterns. In order for the amplitude to decay (not necessary but
occurs in the real harmonograph) the amplitudes can decay as follows,
where d is typically a suitable small positive number. This gives an exponential
decay function. |
APA citation:
Russell, R. (2018, December 03, 11:05 am). Turtle graphics examples.
Retrieved December 22, 2024, from http://www.rupert.id.au/microworlds/trutlegraphics.php
Last refreshed: December 22 2024. 05:32.20 pm
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.