Max or min operators for lists?

I’m looking to find the minimum or maximum numeric value in a list.

In an older (2020) post, I see references to green operator blocks for min and max. But I can’t seem to locate them in the Operators list.

Have they been replaced by something else? Or is there another efficient way to accomplish this?

Thank you.

They're there, but hidden. Grab an arithmetic block from the palette, e.g., a + block. Right-click it, and choose "Relabel" from the menu. Then you can change it into a MIN or MAX.

To apply the block to all the values in a list, drag the list over the arrowhead :arrow_forward:︎ at the end of the block, so you see a red halo around it, then let go. The block name will change to MINIMUM or MAXIMUM and it takes the list as its only input.

Thank you so much! Worked perfectly.

I just discovered Snap! a few days ago, and hadn’t yet stumbled on the “relabel” function. Rather a modest name for such a powerful thing.

You're welcome! And welcome to Snap!.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.