What is the most useful block that you've coded up yourself

This is not a competition to start making blocks :slight_smile:

This is just a showcase for the most used block that you’ve coded up in Snap! that you actually use frequently in your own projects

Mine is this slice reporter
untitled script pic - 2026-01-16T115735.599
It’s coloured red and green to show it works on lists as well as text
It uses the concept of last item being position -1
I use it quite a lot
untitled script pic - 2026-01-16T120956.434
untitled script pic - 2026-01-16T121000.464
or
untitled script pic - 2026-01-16T121004.670

that’s a great one, Simon, so very useful!

I made this block a while back, it is useful for making music within Snap!.
Block made for making compact music.

This block takes lists as an input. The list should be 2 or 3 items long. The first item is the note, the second item is how many beats you want the note to be played for, and the 3rd optional item is how many beats you want of rest.

DefautProject script pic (9)
DefautProject script pic (8)

example1

Here’s where I know this function from (a long time ago)

I often use this block in various projects…

some examples

Here’s mine!

untitled script pic (2)

With this block you can combine sections of a list together. Here is an example:

We start with a list of letters A-J with many duplicates. We now sort the list to group all the A’s together, all the B’s together, etcetera. Next, we add a little one to the start of each to say “there is one copy of this letter”. Finally, we combine items if the letter is the same by adding up their numbers!

There are many use cases I have found, especially doing Advent of Code (which I still need to finish).

PS: I think a list utils library has an assoc block that does the above example, but there are other use cases, like I said. That was just an example.

PPS: Because it uses combine internally, you can make a compiled version too:
untitled script pic (4)

Supplementary block I threw together:

untitled script pic (5)

Please see Rule 1 :slight_smile:

One post - one block please :slight_smile:

Sorry, I just thought it might be a nice addition to their block; a way to engage with their post… I wasn’t trying to make an additional submission (or whatever you want to call it). I had read the rule :).

I usually try not to make custom blocks call other custom blocks in my projects, but here’s my favourite:
TurtleBlocks! script pic (7)

untitled script pic (7)
Despite Jens’s new library using first class colors, I’m still really proud of this block. It knows about HSL, HSV, RGB, X11 color names, crayons, RGB in hex, you name it. The whole colors and crayons library is full of such gems as
untitled script pic (8)
simulated paint mixing, which is hugely complicated, because chemistry.

this is my favorite.

One block I made is:
Animated Buttons script pic
It lets you animate buttons.
I also use it in Scratch.

I don’t get it. what does it do?

That isn’t possible.

The block’s almost impossible to see; but the top C-Slot runs in the background, and the bottom slot is for when you click the sprite/button. There’s some added animations to make it move and grow like a button

I think they mean that they use the logic, and not the block, in Scratch.

thats what i meant