recursion means applying a function to itself. The Scratch equivalent would be nesting a block within its own definition (which is currently impossible in Scratch, but being tested in BYOB)
I'm creating a "move camera" block and a "camera" section, and here's what I think the code for move camera right is; can you please help me?
ScratchStageMorphChangeTo: left start costumeIndex + 1
ScratchSpriteMorphChangeTo: left
fullmoon, I took this project to compare it to the exact same one using my custom block prototype with real recursion, to find out and demonstrate how that one is *much* smaller, more elegant, and easiert to understand
Thanks mathjp! Hey, I like your icon, reminds me of a trip to Bezier and Narbonne this summer, where we ran into a festival with Occitan folk music, food, and wine...
I just downloaded this project and WHOA! saw loads of really complicated-looking scripts. Jens, can you upload a version with annotations explaining what each script does and a brief description of how the heck it does it?!
leox53, it's really just one script duplicated 12 times and changed slightly each time to let it access variable stacks memorizing state for each recursion level. Actually, the algorithm is very simple if coded with "real" recursion, it just gets complicated in the current Scratch version.
Download this project!
Download the one sprite and 14 scripts of "Dragon" and open it in Scratch
Project Notes
Just a quick check how recursion used to work in Scratch...
Comments
You need to be logged in to post comments
Add a Comment
cool
this is cool and weird
Cool, I liked this in byob! Are you still working on panther?
I'm only working on (and supporting) BYOB, Panther was done by others (nXIII, SeptimusHeap, Sparks, Sperry, etc.)
(view all replies)Cool. Like a fractal!
yeah, actually it /is/ a fractal :-)
how is it a dragon??
It's what you get when you fold a piece of paper in half iteration times. Why it's called a dragon I don't know.
Look at wikipedia or something.
eventually it looks like waffles!
you look like waffles.
(view all replies)GUYS I NEED TO KNOW HOW TO MAKE MY SPORE CREATURES MY ICON! HOW! DO! YOU! DO! IT?!?!?!
Recursion?
recursion means applying a function to itself. The Scratch equivalent would be nesting a block within its own definition (which is currently impossible in Scratch, but being tested in BYOB)
(view all replies)the dragon or "jurrasic park" fractal is cool.
Thanks, Jens!
Oh no... It's telling me "nothing more expected"...
aaaaaahhhh... I put in costumeIndex instead of backgroundIndex...
I'm creating a "move camera" block and a "camera" section, and here's what I think the code for move camera right is; can you please help me? ScratchStageMorphChangeTo: left start costumeIndex + 1 ScratchSpriteMorphChangeTo: left
Ooh! Goodie! I was able to create it again!
Darn... I managed to create a boolean reporter block to sense if it was moving, but it shut down on me...
Cool! By the way, I managed to create a "previous costume" block, but to be honest, I think anyone could do that.
(link to project) ...
Wow I like it. you could use this to make a regenerating maze that changes every time you play.
ummm, cool! But what do you mean by "how recursion used to work"?
fullmoon, I took this project to compare it to the exact same one using my custom block prototype with real recursion, to find out and demonstrate how that one is *much* smaller, more elegant, and easiert to understand
Beautiful!I dowload the script.Your first project in my gallery : Best of fractal curves !!
Thanks mathjp! Hey, I like your icon, reminds me of a trip to Bezier and Narbonne this summer, where we ran into a festival with Occitan folk music, food, and wine...
(view all replies)I just downloaded this project and WHOA! saw loads of really complicated-looking scripts. Jens, can you upload a version with annotations explaining what each script does and a brief description of how the heck it does it?!
leox53, it's really just one script duplicated 12 times and changed slightly each time to let it access variable stacks memorizing state for each recursion level. Actually, the algorithm is very simple if coded with "real" recursion, it just gets complicated in the current Scratch version.