Discuss Scratch

alexphan
Scratcher
1000+ posts

Elif (else-if) block

Support. Maybe we should add a “plus” symbol next to else to make another case. Also, would you rather have this?

if <> then

else
if <> then

else

if <> then

else

if <> then

else
if <> then

else
if <> then

else
if <> then

else

if <> then

else

if <> then

else

if <> then

else

if <> then

else

if <> then

else
rdococ
Scratcher
1000+ posts

Elif (else-if) block

Why not have separate else blocks? It might be a bit confusing and hard to implement, but it wouldn't add any unnecessary clutter.
if <(x) = (2)> then
say [It's two!]
end
else if <(x) = (3)> then ::cstart control
say [It's three!]
end
else ::cstart
say [What is it?]
end
alexphan
Scratcher
1000+ posts

Elif (else-if) block

rdococ wrote:

Why not have separate else blocks? It might be a bit confusing and hard to implement, but it wouldn't add any unnecessary clutter.
if <(x) = (2)> then
say [It's two!]
end
else if <(x) = (3)> then ::cstart control
say [It's three!]
end
else ::cstart
say [What is it?]
end

What if you did this?
when green flag clicked
else ::cstart
say [...what?]
else if <(x) = (3)> then ::cstart control
say [It's three!]

end
end
Sigton
Scratcher
1000+ posts

Elif (else-if) block

I love this block in Python; please add it to Scratch!
Support!

Sigton
theonlygusti
Scratcher
1000+ posts

Elif (else-if) block

Sigton wrote:

I love this block in Python; please add it to Scratch!
Support!

Sigton
Yep, because in Python it is also called a “block”

If it is added, I really hope they don't call it elif. ugh. Disgusting.
TylerStein
Scratcher
13 posts

Elif (else-if) block

<<> and < >>
ivancr72
Scratcher
100+ posts

Elif (else-if) block

Oops, didn't see the second page
Support per invisibowl.

Last edited by ivancr72 (June 25, 2016 10:22:35)

TylerStein
Scratcher
13 posts

Elif (else-if) block

define dog
DaSpudLord
Scratcher
1000+ posts

Elif (else-if) block

TylerStein wrote:

<<> and < >>

TylerStein wrote:

define dog
Please don't blockspam.
space_elephant
Scratcher
500+ posts

Elif (else-if) block

I think it would be useful to have else-ifs and be able to add or remove the else so here is an idea for how it could work:

The if block could start with an arrow button like this
if<>then{}@addInput::control
and when you click that button, it adds an else or if there is an else already then it adds an else-if before the else.
In every state except the starting state, there would be another arrow, before if, pointing in the other direction.
Pressing thet button would remove the else, or remove an else-if.

It would likely be a good idea to put the block in the palette in two states, makeing the control palette be like this
wait (1) secs

repeat (10)
end
forever
end
if <> then{}@addInput::control
if <> then{}else{}@delInput @addInput::control
wait until <>
repeat until <>
end

stop [all v]

when I start as a clone
create clone of [myself v]
delete this clone
gems89
Scratcher
1000+ posts

Elif (else-if) block

I dont really see the point. it takes like 2-7 seconds to replace the script.

you could just do this

if <> then

end

Or

if <> then 



else

end

And add it as many times as you need

No support.
The4thPixel
Scratcher
1000+ posts

Elif (else-if) block

I support. It would save time and effort, especially when dealing with long booleans or scripts.
dvargasews
Scratcher
500+ posts

Elif (else-if) block

I don't like this idea because in a project that I'm working on with someone else, I decided to reorganize the baryon-recognizing scripts in the stage, which meant rearranging a bunch of then-linearly-organized if-else statements, and that would have been much more difficult and time-consuming if I hadn't had separate if-else blocks. Also, now I want to add the anit-nucleons and anti-delta baryons to the list, but I want to add it to the middle for organization, and if there was only one if-else block, moving almost everything already there several elses down would be very time-consuming. I don't think that this would be helpful or useful overall.

Last edited by dvargasews (Jan. 30, 2017 02:58:42)

duckboycool
Scratcher
1000+ posts

Elif (else-if) block

It's not the type of thing that would kill page even with lower specs (Like with my computer), but it would cause some lag an pretty much any computer regardless. moral of the story, don't do it But to make this post actually valuable, what would be the point of just putting block out in the open when you remove them from an else, what else would you use them for where you couldn't just drag them out?

Last edited by duckboycool (Jan. 27, 2017 01:15:43)

WolfCat67
Scratcher
1000+ posts

Elif (else-if) block

I feel like this suggestion doesn't need to be added. Like dvargasews pointed out, it may be a lot easier in some situations to just move the “if-else” blocks out of the way and add more than keep adding onto it. It also doesn't even take much time to do; only around 7 or so seconds.
I'm sorry, but no support for this one.

Last edited by WolfCat67 (Jan. 30, 2017 03:24:22)

VideoGamerCanInvent
Scratcher
1000+ posts

Elif (else-if) block

WolfCat67 wrote:

Everyone, get back on topic and stop talking about computers almost crashing because of Scratch blocks!

P.S. My computer didn't even start to lag, and I have a laptop.
My browser / operating system: Windows NT 10.0, Chrome 51.0.2704.79, Flash 24.0 (release 0)

—–
I feel like this suggestion doesn't need to be added. Like dvargasews pointed out, it may be a lot easier in some situations to just move the “if-else” blocks out of the way and add more than keep adding onto it. It also doesn't even take much time to do; only around 7 or so seconds.
I'm sorry, but no support for this one.
You do have an older version of Google Chrome… could that have anything to do w/ it?
TheMonsterOfTheDeep
Scratcher
1000+ posts

Elif (else-if) block

dvargasews wrote:

I don't like this idea because in a project that I'm working on with someone else, I decided to reorganize the baryon-recognizing scripts in the stage, changing and that would have been much more difficult and time-consuming if I hadn't had separate if-else blocks. Also, now I want to add the anit-nucleons and anti-delta baryons to the list, but I want to add it to the middle for organization, and if there was only one if-else block, moving almost everything already there several elses down would be very time-consuming. I don't think that this would be helpful or useful overall.
I feel like this isn't really a valid reason to no-support, because
a) It wouldn't be that hard to simply drag each script from it's previous spot in the next and move it, and
b) that's not really the best way to implement what you're trying to do anyways…
dvargasews
Scratcher
500+ posts

Elif (else-if) block

duckboycool wrote:

It's not the type of thing that would kill page even with lower specs (Like with my computer), but it would cause some lag an pretty much any computer regardless. moral of the story, don't do it But to make this post actually valuable, what would be the point of just putting block out in the open when you remove them from an else, what else would you use them for where you couldn't just drag them out?
I'm having trouble figuring out what parts of that were directed towards me, but I'll try to answer.
It caused slight lag on my computer, but not enough so that I figured that it would be a problem.
I didn't put them in the open; I rearranged them to reduce total calculations (and therefore lag) and so the extra organization would make it easier to understand and edit.
dvargasews
Scratcher
500+ posts

Elif (else-if) block

TheMonsterOfTheDeep wrote:

dvargasews wrote:

I don't like this idea because in a project that I'm working on with someone else, I decided to reorganize the baryon-recognizing scripts in the stage, changing and that would have been much more difficult and time-consuming if I hadn't had separate if-else blocks. Also, now I want to add the anit-nucleons and anti-delta baryons to the list, but I want to add it to the middle for organization, and if there was only one if-else block, moving almost everything already there several elses down would be very time-consuming. I don't think that this would be helpful or useful overall.
I feel like this isn't really a valid reason to no-support, because
a) It wouldn't be that hard to simply drag each script from it's previous spot in the next and move it, and
b) that's not really the best way to implement what you're trying to do anyways…
No, but it's time-consuming.
I changed it since then!
Mario0314
Scratcher
7 posts

Elif (else-if) block

Sorry but no support.
I never really find myself using more than 2-3 if-else blocks in one place and that isn't very complicated to set up, so I don't feel like this is necessary. Plus there is also the duplicating feature that can make it easier if you need to set up a lot.

Powered by DjangoBB