ScratchData LogoScratchData
Back to Greybird's profile

Sierpinski Triangle Rendering program

GRGreybird•Created October 27, 2017
Sierpinski Triangle Rendering program
70
52
921 views
View on Scratch

Instructions

Click the green flag to see iterations 1 to 9, one after another. Press space to choose an iteration to render The program will draw a Sierpinski Triangle, with x-pos controlling the pitch of the music notes and y-pos controlling the volume of the notes from 5% to 100%. Use turbo mode for faster rendering and faster music Thanks to @scottie_uk for inspiration about the colour.

Description

This project generates each generation from the previous one. It uses only a list of right(R), left(L), and double left(2) turns; and never travels straight through an intersection. Starting with 22, then R22LL22R each subsequent generation uses 2^(iteration)-3 repetitions of R2R then the whole of the previous generation. Next it adds an L, and then deletes all characters from the beginning and end of the previous generation's code until it reaches an L. The program joins this to the L at the end of the current code, then adds another L behind it. Then the whole of the previous code is added again, with the same 2^(iteration)-3 repititions of R2R after that. This constitutes the next iteration. it 1: 22 it 2: R22LL22R it 3: R2RR22LL22RLLLLR22LL22RR2R it 4: R2RR2RR2RR22LL22RLLLLR22LL22RR2RLLL22RLLLLR22LL LR2RR22LL22RLLLLR22LL22RR2RR2RR2R 200 views as of 11/7/2017 300 views as of 11/8/2017 400 views as of 11/14/2017 500 views as of 11/20/2017 600 views as of 10/4/2018 ... :)

Project Details

Project ID182523919
CreatedOctober 27, 2017
Last ModifiedOctober 18, 2018
SharedOctober 27, 2017
Visibilityvisible
CommentsAllowed