it would be like
____________
| switch () |
| case (): [-]|
| | |_|
| |_______
| case (): [-]|
| | |_|
| |_______
| default: [+]|
| | |_|
| |__________
|____________|
and what it does is first it works out the value of the "switch" input. Then it checks each "case" input and if one matches the value that is in the "switch" bit, it runs the blocks in that input. If there is no match, it runs the blocks in the "default" bit. The - buttons next to each case will delete that case and the + button by the default will add another case.
supporters: 5
joefarebrother
scimonster
catperson
rdococ
veggieman001
Last edited by joefarebrother (2012-02-21 12:12:56)
Offline
SJRCS_011 wrote:
This is basically two nested "If Else" blocks, though.
A few more blocks won't hurt.
Not exactly. It works out the main value first, than works out the case values and compares them to the main value. You can also add more cases using the + button.
Offline
Yes.
Offline
scimonster wrote:
Yes.
does that mean you support?
Offline
joefarebrother wrote:
scimonster wrote:
Yes.
does that mean you support?
scimonster wrote:
Yes.
Offline
I support.
Offline
this already exists
if <(blah) = (bloh)> if <(evil) = (funny)> go to [your doom v] else if <(mwahhaha) = (evil laugh)> go to [your room v] else set [good v] to [evil] end end endis that what you mean if so are you asking for the else if command witch exists in other languages but might be confuse to many kids witch is what scratch is meant for right?
Last edited by zakattack7 (2012-02-20 10:07:54)
Offline
zakattack7 wrote:
this already exists
if <(blah) = (bloh)> if <(evil) = (funny)> go to [your doom v] else if <(mwahhaha) = (evil laugh)> go to [your room v] else set [good v] to [evil] end end endis that what you mean if so are you asking for the else if command witch exists in other languages but might be confuse to many kids witch is what scratch is meant for right?
but you can still use this command by placing else and if blocks next to each other
no, this is the switch block in other programming languages, not the if/else block.
Offline
I love this idea and support, but it might be really confusing to new Scratchers and younger members
Offline
You can do this already with the if/else blocks.
Offline
ProgramCAT wrote:
You can do this already with the if/else blocks.
yes, i KNOW you could just do
if <(switch) = [case1]> do case1 else if <(switch) = [case2]> do case2 else if <(switch) = [case3]> do case3 else if <(switch) = [case4]> do case4 else if <(switch) = [case5]> do case5 else if <(switch) = [case6]> do case6 else if <(switch) = [case7]> do case7 else if <(switch) = [case8]> do case8 else if <(switch) = [case9]> do case9 else if <(switch) = [case10]> do case10 else if <(switch) = [case11]> do case11 else if <(switch) = [case12]> do case12 else do defaultBut this can get VERY laggy if there are alot of cases, and you have to drag out loads of nearly identical structures to do this, and besides: the switch structure is in many, many programming languages anyway.
Last edited by joefarebrother (2012-04-11 14:41:20)
Offline