Math = Art! | Logo 15-word challenge |
winners other entries |
"Write a Logo one-liner using 15 or fewer words, not counting square brackets and parentheses, to produce the most beautiful, complex, and interesting picture."
The one-line codes work as written in MSWLogo and UCBLogo. MicroWorlds sometimes requires slightly different code, as noted below in the Winners' section, and cannot run code using the command "px" (which reverses the color).
Click here for information on downloading free versions of Logo.
Please see the project details for the project background, extra code, and more graphics.
The 6 can be replaced with 1 to 7 for other flowers.
This is slow, but it has very beautiful and complex moire patterns. If your screen is small, let it wrap. The moire effect isn't as strong if you try to shrink it.
Lissajous variations, by Samuel Kilchenmann, Switzerland (15 words)
dotimes [i 360] [setpos list (sin(254 * :i)) * 150 (sin(201 * :i)) *
150]
(MicroWorlds)
Change the factors to get lots of different designs.
This looks remarkably like a person is sketching with
a pencil. It looks even more like a pencil sketch
if you use PENREVERSE (PX) mode.
for [l 10 80 5] [repeat 5 [repeat 8 [fd :l rt 45] rt 72]
Beautiful "telescoping" polygons.
Change the numbers to get more designs.
px setpensize [100 100] repeat 1000 [repeat 72 [fd 20 rt 10] rt 90]
This requires PENREVERSE (PX) and a big pen.
other ring variations
This requires PENREVERSE (PX).
This requires PENREVERSE (PX).
It seems simple, but it has a suprising effect, based on WRAP mode and PX mode.
The effect will depend on your screen size. The effect is strikingly bold with a square screen and more complex with a non-square screen.
In MSW Logo, you can set the screen size.
Example: c:\\logo\\logo -h 480 -w 640
Five Rose or Starfish, by , Italy (and , Australia) - only 8 words!!
dotimes [i 1800] [fd 10 rt :i + .1] (MicroWorlds)
Dahlia, by , U.S. (14 words)
For numbers greater than 7, the patterns repeat.
This will work without modification in absolutely all Logo implementations.
Layers, by Alessio Plebe, Italy (15 words)
dotimes [i 420] [seth :i repeat :i [fd 2 rt 1] pu home pd]
(MicroWorlds)
repeat 360 [setxy (sin(89 * repcount)) * 150 (sin(179 * repcount)) *
150]
repeat 360 [setxy (sin(254 * repcount)) * 150 (sin(201 * repcount)) *
150]
repeat 360 [setxy (sin(327 * repcount)) * 150 (sin(66 * repcount)) *
150]
Pencil Sketch, by Andrzej Baczynski
(shortened by Yehuda Katz), 15 words
Penta-octagon, by M.H. Elhefni, Egypt (15 words)
dotimes [i 15] [repeat 5 [repeat 8 [fd (10 + (:i * 5)) rt 45] rt 72] (MicroWorlds)
(See the "octa-octagon" below.)
Circus (Ring variation 2), by Olga Tuzova, Russia (14 words)
This cheerful entry reminds me of circus jugglers and clowns doing cartwheels.
Radar, by Zippi Katz, Israel (11 words)
It looks like a weather radar. [It is in constant motion.]
The really interesting part is that the
effect is entirely destroyed
if you replace "fd 40 fd 40" by "fd 80".
Square Spiral, by Yehuda Katz, Israel (9 words)
for [i 0 2000] [fd 5 rt (90 * sin :i)]
for [i 0 4700] [fd 10 rt (180 * sin (:i * :i))]
for [i 0 2200] [fd (25 * sin :i) rt (:i * :i)]
for [i 0 1002] [fd 8 seth (360 * (power :i 3) / 1002)]
REFERENCES
repeat random 1000 [fd random 1000 rt random 360]
(This usually produces Jackson Pollacks, but there is
a chance that it will produce a Michelangelo.) Depending on what random numbers the computer chooses, you may get something like one of the three images above.
px for[x 1 1000000] [fd :x rt 89.99]
make "x 1 repeat 150 [fd :x rt 89 make "x :x + 1]
sety 1000 home setx 1000 for [x -180 180] [setxy :x 70 * sin :x]
repeat 3600 [px fd 80 fd 0 bk 80 lt random 360]
px repeat 10000 [fd 200 rt 179]
repeat 10000 [fd 3 * (-1 + random 2) rt 90 * random 4]
(Maybe it should be named urban sprawl.)
repeat 12 [repeat random 50 [fd 100 bk 95 rt 2] rt 180]
repeat 50 [repeat random 100 [fd 300 bk 295 rt 2] rt 180]
reset for [i 0.01 4 0.05] [repeat 180 [fd :i rt 1]]
px setpensize [20 20] repeat 100000 [fd 2 rt 2]
(Looks like a caterpillar in motion.)
px setpensize [200 200] repeat 36 [fd 20 rt 10]
px for [x 10 200] [setpensize se :x :x repeat 36 [fd 20 rt 15]]
setsc [0 0 0] px setpensize [10 10] repeat 100000 [fd 10 rt random 360]
setpensize [10 10] repeat 10000 [pu fd 15 pd fd 0 rt random 360]
px setpensize [10 10] repeat 10000 [pu fd 15 pd fd 0 rt random 360]
for [t 0 180 3] [seth :t fd 200 * sin :t home]
for [t 0 180] [seth :t fd 200 * sin :t*7 home]
repeat 9 [for [i 10 200 10] [fd :i bk :i rt 2]]
for [t 0 360] [setxy 200 * sin :t 200 * cos :t * 5]
for [i 1 10] [repeat 10 [type form repcount * :i 4 0] pr[]]
(This one uses the text screen.)
for [scr .2 1.75 .05] [setscrunch 1 :scr repeat 360 [fd :scr rt 1]]
repeat 8 [repeat 4 [rt 90 fd 100] bk 100 lt 45]
repeat 1000 [fd 3 rt random int 20 * (1 + sin (10 * repcount))]
repeat 12 [repeat 75 [fd 100 bk 100 rt 2] fd 250]
repeat 5100 [fd 10 rt arctan (remainder repcount 100) / 100]
reset repeat 3600 [setxy repcount / 10 * sin repcount repcount/20 * cos repcount]
repeat 36000 [setxy (sqrt repcount) * sin repcount (sqrt repcount) * cos repcount]
repeat 6000 [fd repcount rt remainder repcount 360]
repeat 11 [for [i 0 359] [fd 1 rt (sin :i / 2)]]
(Why does the line match up exactly after drawing 11 petals?)
(Clever use of the triangular turtle. The second hand continually moves as it is drawn, erased, and repositioned.)
(Try this: first run Face, then, without clearing the screen, run Seconds.)
invoke [[x] print (list "invoke :x :x)] [[x] print (list "invoke :x :x)]
(This non-graphics one-liner prints itself.)
define "spin [[ ][repeat 15 [fd 100 bk 100 rt 5]]] repeat 25 [spin fd
100]
repeat 25 [repeat 15 [fd 100 bk 100 rt 5] fd 100]
pu setx -100 pd
repeat 2000 [pu home seth random 361 fd 40 pd fd random 200]
for [i 100 30 -50] [repeat 6 [repeat 6 [fd :i lt 60] lt 60]]
(Quasi-fractal.)
for [size 20 80 20] [repeat 6 [repeat 6 [fd :size rt 60] rt 60]]
for [i 100 10 -5] [repeat 6 [repeat 6 [fd :i lt 60] lt 60]]
repeat 5 [repeat 6 [fd 100 lt 72] lt 144]
for [i 100 10 -5] [repeat 5 [repeat 6 [fd :i lt 72] lt 144]]
for [i 100 10 -10] [repeat 5 [repeat 5 [fd :i lt 72] lt 72]]
window repeat 180 [fd 500 bk 500 rt 2]
for [i 0 220 0.0001*sin :i] [fd :i bk :i rt 10]
for [i 0 220 sin :i/1000] [fd :i bk :i rt 51]
for [i 0 220 sin :i/1000] [fd :i bk :i rt 41]
repeat 450 [make "a 73 * sin repcount fd :a rt 88 * cos :a]
for [i -1 4] [repeat 720 [fd power 2 :i rt repcount]]
for [i -1 15] [repeat 720 [fd power 1.2 :i rt repcount] lt 45]
for [i 1 14 6] [repeat 720 [fd :i rt repcount]]
for [i 1 18 2] [repeat 720 [fd :i rt repcount] lt 45]
repeat 2000 [setxy (repcount * 2) (ycor - 2 + random 5)]
repeat 38 [fd 5 rt 10] setx 55 setx 27 setxy 20 -10 setx 27
repeat 1800 [fd ln repcount bk 10*sin repcount rt 10]
repeat 360 [repeat repcount [repeat repcount [fd repcount lt 15] home]
lt 1]
(You may want to stop it before it is done.)
px repeat 360 [repeat repcount [repeat repcount [fd repcount lt 15] home] lt 1]
(Read the book.)
repeat 360 [rt repcount fd 1 lt repcount * 2 fd 0.5 rt repcount]
(The eccentricity is e=0.5. If e=0, you have a circle and
if e < 0 or e > 0 you have an ellipse, horizontal or vertical.
repeat 4 [repeat 30 [lt 90 fd 4 rt 90 fd 4] rt 90]
repeat 4 [repeat 20 [lt 160 fd 20 rt 160 fd 20] rt 90]
repeat 8 [repeat 20 [lt 170 fd 20 rt 170 fd 20] rt 45]
px repeat 4000 [repeat 34 [fd 12 rt 10] rt 90]
px repeat 360 [setx 200 * (cos repcount) sety xcor * (cos repcount) home]
pu setx -157 pd
(It looks better like this:
repeat 360 [setx 200 * (sin repcount) sety xcor * (cos 2 * repcount) home]
repeat 360 [setx 200 * (sin 2 * repcount) sety xcor * (cos repcount) home]
repeat 360 [setx 200 * (cos 2 * repcount) sety xcor * (cos repcount) home]
repeat 25726 [setpos se (50 - random 100) (50 - random 100)]
for [l 0 120 4] [repeat 8 [fd :l rt 135] fd :l rt 30]
for [l 0 95 3] [repeat 5 [fd :l rt 144] fd :l rt 30]
repeat 36 [fd 60 rt 61 bk 80 lt 41 fd 85 rt 41]
repeat 36 [repeat 36 [fd 10 rt 10] fd repcount rt 90 fd repcount]
repeat 18 [repeat 5 [rt 40 fd 100 rt 120] rt 20]
index
Hairy Star
index
Jaggy Star
index
Bullring
"Another Fine Math You've Got Me Into..." by Ian Stewart
contains an interesting chapter about curves like these.
The "bullring" is from Ian Stewart's book.
index
Random Lines, by , U.S. (9 words)
index
Square Spiral variation 1, by Keith Enevoldsen, U.S. (9 words)
saved in early stage
Square Spiral variation 2, by Bill Kerr, Australia (14 words or 8 words)
for [x 1 150] [fd :x rt 89]
index
Sine Wave, by Shachar Katz, Israel (15 words)
index
Radar variation 1, by Bill Kerr, Australia (12 words)
Radar variation 2, by Keith Enevoldsen, U.S. (7 words)
index
Brownian Motion, by Erez Katz, Israel (14 words)
index
Feathers, by , U.S. (13 words)
Feathers variation 1, by Keith Enevoldsen, U.S. (13 words)
index
Spiral, by Olga Tuzova, Russia (11 words)
index
Ring, by Olga Tuzova, Russia (10 words)
Ring variation 1, by Keith Enevoldsen, U.S. (10 words)
index
Cubism (Ring variation 3), by Yehuda Katz, Israel (15 words)
index
Milky Way, by Olga Tuzova, Russia (15 words)
index
Inky Dots, by Olga Tuzova, Russia (14 words)
Inky Dots variation 1, by Yehuda Katz, Israel (15 words)
index
Rose, by M.H. Elhefni, Egypt (shortened by Yehuda Katz, Israel, 13 words)
Rose variation 1, by Keith Enevoldsen, U.S. (14 words)
Rose variation 2, by M.H. Elhefni, Egypt (13 words)
index
Lissajous, by M.H. Elhefni, Egypt (15 words)
index
Times, by Yehuda Katz, Israel (14 words)
index
Shell, by Vered Katz, Israel (14 words)
index
Hypercube, by Frank Caggiano, U.S. (12 words)
index
Scribble, by Keith Enevoldsen, U.S. (15 words)
index
Fan Flower, by Keith Enevoldsen, U.S. (12 words)
index
Current, by George Mills, U.S. (10 words)
index
Elliptical Spiral, by George Mills, U.S. (15 words)
index
Tree Growth Rings, by George Mills, U.S. (13 words)
index
Cloudy Night, by George Mills, U.S. (8 words)
index
Simple Flower, by , Australia (13 words)
index
Seconds, by Zippi Katz, Israel (15 words)
index
Self-Replicating, by Brian Harvey, U.S. (13 words)
index
Basic Spinning Wheel variations 1-3, by Greg Simkins' 6th grade class, U.S. (15 words)
define "spin [[ ][repeat 15 [fd 100 bk 95 rt 10]]] repeat 12 [spin fd
100]
pu setpos [-400 0] pd
define "spin [[ ][repeat 25 [fd 100 bk 100 rt 15]]] repeat 24 [spin fd 100]
repeat 12 [repeat 15 [fd 100 bk 95 rt 10] fd 100]
pu setpos [-400 0] pd
repeat 24 [repeat 25 [fd 100 bk 100 rt 15] fd 100]
index
Low, by Alessio Plebe, Italy (15 words)
for [i 0 32] [repeat :i [fd :i rt 358 / :i] bk sqrt :i]
index
Sun, by Alessio Plebe, Italy (13 words)
index
Hexagon, by M.H. Elhefni, Egypt (15 words)
Hexagon variation 1, by Yehuda Katz, Israel (15 words)
Hexagon variation 2, by M.H. Elhefni, Egypt (15 words)
index
Pentahexagon, by M.H. Elhefni, Egypt
(shortened by Keith Enevoldsen, U.S.) (10 words)
Pentahexagon variation 1, by M.H. Elhefni, Egypt (15 words)
index
Pentagon, by M.H. Elhefni, Egypt (15 words)
index
Moire, by Yehuda Katz, Israel (9 words)
index
Fireworks, by M.H. Elhefni, Egypt (14 words)
index
Peltonwheel, by M.H. Elhefni, Egypt (14 words)
index
Spirals, by M.H. Elhefni, Egypt (14 words)
index
Gillyflower, by Alessio Plebe, Italy (15 words)
index
Growing Scrolls variation 1, by Keith Enevoldsen, U.S. (12 words)
Growing Scrolls variation 2, by Keith Enevoldsen, U.S. (14 words)
Growing Scrolls variation 3, by M.H. Elhefni, Egypt (11 words)
Growing Scrolls variation 4, by M.H. Elhefni, Egypt (13 words)
index
Mountains, by Keith Enevoldsen, U.S. (12 words)
index
Head, by Keith Enevoldsen, U.S. (15 words)
repeat 38 [fd 5 rt 10] setx 55 setx 27 setpos [20 -10] setx 27 (MicroWorlds)
index
Eye, by , Italy (12 words)
index
Growing, by , Italy (13 words)
index
Don Quixote, by , Italy (14 words)
index
Ellipse, by , Italy (14 words)
See Abelson-Di Sessa: "Turtle geometry".)
index
Polygon variations 1-3, by , Italy (14 words)
index
Rotating Circle, by M.H. Elhefni, Egypt (11 words)
index
Disappearing Triangles, by Olga Tuzova, Russia (14 words)
index
Smiling Fish, by Yehuda Katz, Israel (15 words)
for [t -315 315] [setxy :t * sin :t :t * cos 2 * :t]
for [t -315 315] [setxy :t * sin :t .5 * :t * cos 2 * :t]
as pictured above, but then it is too many words.)
index
Bird's Wings, by Olga Tuzova, Russia (15 words)
index
Butterfly, by Olga Tuzova, Russia (15 words)
index
Fish, by Olga Tuzova, Russia (15 words)
index
Block, by de Walt Smith, U.S. (12 words)
index
Octa-star Spiral, by M.H. Elhefni, Egypt (15 words)
index
Penta-star Spiral, 15W, M.H. Elhefni, Egypt (15 words)
index
Designs 1-5, by Alex Mylonas' class, Greece (12 - 14 words)
repeat 16 [fd 85 lt 60 fd 107 bk 72 lt 53 fd 74]
repeat 100 [fd 5 + repcount rt 45 fd 10 + repcount rt 60]
index
math cats' mailroom