ScratchData LogoScratchData
Back to _nix's profile

Recursive diamond animation!

_N_nix•Created May 28, 2024
Recursive diamond animation!
8
3
51 views
View on Scratch

Description

"Oh, but where's the recursion!?" you ask! "That just looks like a normal diamond to me!" Well, yes, it is :) This program shows that you can make an animation in Scratch using *only* recursive custom blocks — that means a custom block which runs itself over again. Scratch will detect that (up to 5 layers removed, we believe) and "yield" automatically for you, even though you didn't use any blocks that would normally yield! (Those are loops and "wait 0 seconds" and similar ones.) After all, a recursive custom block really is sort of like a loop, you know? It's running its insides... over again! See inside for a bunch of goodies, if you're curious. Just for fun, we coded this without using any variables, but still had the code remember lots of useful values! This is also for testing compatibility in other implementations of Scratch, to see if they yield during some fairly simple recursion. But mostly it's just a fun example, and you'd need a more convoluted script to test Scratch's nuances perfectly.

Project Details

Project ID1028790641
CreatedMay 28, 2024
Last ModifiedMay 28, 2024
SharedMay 28, 2024
Visibilityvisible
CommentsAllowed