The Sierpinski Triangle on Scratch

December 2017, Year 1, age 5

HB and Dad looked at Scratch projects that draw the Sierpinski triangle. (Take a look here if you'd like to explore some too.) HB's Dad then helped HB to write a program that creates a sierpinski triangle, in a way quite different from our drawings.

creating the sierpinski triangle with Scratch     creating the sierpinski triangle with Scratch creating the sierpinski triangle with Scratch     creating the sierpinski triangle with Scratch

This program begins at one corner of the triangle. It then draws a dot half way between that corner and another corner, chosen at random. A second dot is drawn half way between the first dot and another corner, chosen at random. A third dot is drawn half way between the second dot and a random corner. This is repeated forever. Intially the pattern appears random, but as the number of dots grows, a Sierpinski triangle emerges. You can re-run the program and see different dots appear, but the end result will be the same.

back to Previous Adventure next adventure


Related Adventures