How do I make a 'switch', 'case' and 'default' block?

I am working on a project and I need something to replace this:
snapblocks (9) 11 blocks
How do I make something like this:

10 blocks
11 vs 10 blocks, small difference here but a big difference for bigger projects.

P.S. for the default block you can make it a cap by duplicating the block definition of a cap block in Snap! 10.0 even though it is rendered as type 1 (command) in snapblocks (11) but the cap block is optional.

If you look above the simple if/else block in the control palette, you should see this block

untitled script pic (3)
which can be expanded to give the structure you are after

untitled script pic (2)

Note: to get the final else - just leave the else if set to true

but I cant do this
snapblocks (12) 6 blocks
so i have to do this
snapblocks (14) 7 blocks
7 vs 6 blocks, like I said, small difference here but a big difference for bigger projects.

em - unless I'm missing something, you can do exactly what the 1st script does

Try it for real and come back if it fails for you

Here we go:

switch case script pic (1)

switch case script pic (2)

Now place as you would do to make a swiitch-case then tada!

i will test this. this post will be the solution if it works

This is what I'd do
[edited to make a bit simpler]
untitled script pic (5)


thanks! It works!

P.S. I realised when you edit a duplicated cap block it turns back to a command so the default is a normal Cblock

or you can use the old library:
CASE script pic (2)

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