Discuss Scratch
- Discussion Forums
- » Suggestions
- » Elif (else-if) block
- Malicondi
-
1000+ posts
Elif (else-if) block
I suggested the ability to add more and it could go up to nine or something. You could remove it and any code inside would simply just be kicked out of that statement, but it wouldn't be deleted
but how would you extend the elifs?
Last edited by Malicondi (March 3, 2024 19:29:07)
- The-Sushi-Cat
-
500+ posts
Elif (else-if) block
Lil' plus at the bottom of the blockI suggested the ability to add more and it could go up to nine or something. You could remove it and any code inside would simply just be kicked out of that statement, but it wouldn't be deletedbut how would you extend the elifs?
Lmao statement was not the right word
Last edited by The-Sushi-Cat (March 3, 2024 19:41:00)
- Malicondi
-
1000+ posts
Elif (else-if) block
seems simple enought, support.Lil' plus at the bottom of the statementI suggested the ability to add more and it could go up to nine or something. You could remove it and any code inside would simply just be kicked out of that statement, but it wouldn't be deletedbut how would you extend the elifs?
- Sussycrewmate12
-
9 posts
Elif (else-if) block
Support because this would make most codes become a large mess of orange blocks a bit less, and also because I might as well because I supported a dupe.
Last edited by Sussycrewmate12 (March 7, 2024 17:15:46)
- MagentaDude1359
-
100+ posts
Elif (else-if) block
support, it can get real messy when using a ton of if-elses
- StarSubject
-
70 posts
Elif (else-if) block
An else if block would look like this:
if <> then {
…
}elseif<>{
…
- ihavenocluewhythisis
-
500+ posts
Elif (else-if) block
Python users do, as that's the name of the Python keyword. First of all, nobody calls it Elif. It's “elseif” or “else if”.
What's wrong with simply stacking if/elses?if <...> then
...
else
if <...> then
...
else
if <...> then
...
else
if <...> then
...
else
...
its too big
- BringUpYourPost
-
500+ posts
Elif (else-if) block
This will encourage nesting, as a never nesting no support
- jmdzti_0-0
-
500+ posts
Elif (else-if) block
Support!if <>Ah, there we go.
else <>
else <>
end
So how would this be made, exactly? Would there be (+) at the bottom part of the loop so when it's clicked the above happens? I support.
Would look like this
if <> then{
}else if <>{
}@delInput@addInput::control
- Quantum1993
-
500+ posts
Elif (else-if) block
Couldn't you just do this? I suggest adding an Elif (else-if) Block so you don't have to have numerous else and if blocks. I also suggest, with this, that you can change the elif amount ( making it changeable by length through numbers as part of the elif block.).
I hope you take this into account, as I would find it very useful.(Feels like a speech! XD)
if <> then
else
if <> then
end
end
- starlightsparker
-
1000+ posts
Elif (else-if) block
Oh my god we get it
Yes, you can do that
but it stacks blocks and that becomes messy
Yes, you can do that
but it stacks blocks and that becomes messy
- ywc2
-
85 posts
Elif (else-if) block
Interesting, but it might confuse new users because it's unclear which way the code will go since there are multiple possible outputs, the standard if-else chain is simple to understand.
- Quantum1993
-
500+ posts
Elif (else-if) block
I agree with @ywc2. This would be confusing to most users. Oh my god we get it
Yes, you can do that
but it stacks blocks and that becomes messy
- scratchyGabby6
-
100+ posts
Elif (else-if) block
it's the opposite as without this block it would look like this: This will encourage nesting, as a never nesting no support
if <> thenbut with the elseif block, it would look like this:
else
if <> then
else
if <> then
else
if <> then
else
if <> then
else
if <> then
else
end
end
end
end
end
end
if <> then {where the backward arrow removes the corresponding “else if” statement and the front facing arrow adds an “else if” statement
} else if <> then @delInput {
} else if <> then @delInput {
} else if <> then @delInput {
} else if <> then @delInput {
} else if <> then @delInput {
} else {
} @addInput :: control
- Davido2210
-
27 posts
Elif (else-if) block
Me I play around with programming languages other than Scratch a little, and I notice they have something Scratch doesn't have - an else-if block.
For example, this example code uses elseif:
if (thing) {
do stuff
} else if (other thing) {
do other stuff
} else {
more stuff
}
I think this could be included in the if-else block by adding two arrows button on the side of the block, like some other blocks in Snap! have, to add an else if. I see that you can already do this with nested if-else blocks, but that gets really messy and confusing quickly. Here is what I am talking about by “nested if-else”:if <condition> then
some stuff
else
if <condition2> then
do other stuff
end
end
Zebra coloring would not be added, because the if/else if/else will be one big block, like this:if <> thenPeople who think this is a good idea (AKA Supporters):
example
else if <> :: celse
another example
else if <> :: celse
more stuff
else
yet another example
end
Tymewalk (That's me! Wait, don't I already support my own idea?)
MathlyCat
JamesOuO
cwkethan1508
liam48D
theonlygusti
IronBit_Studios
Nether_before
Vetpetmon
A-no-meep
chuckdaboss
Gaza101
pokejafe
PotOfGold
14 supporters
Semi-supporters:
stickfiregames
matey1234
Invisibowl
Who else thinks this is a good idea?
- BigNate469
-
1000+ posts
Elif (else-if) block
I support. I don't like nesting so many if-then-else blocks.
Also, this is already a feature in most other Blockly-based programming languages, why not add it to Scratch?
Also, this is already a feature in most other Blockly-based programming languages, why not add it to Scratch?
- ihavenocluewhythisis
-
500+ posts
Elif (else-if) block
I suggest adding an Elif (else-if) Block so you don't have to have numerous else and if blocks. I also suggest, with this, that you can change the elif amount ( making it changeable by length through numbers as part of the elif block.).
I hope you take this into account, as I would find it very useful.(Feels like a speech! XD)
heres a elif just because
if <> is true then {code} else if <> is true {more code} else{even more code} [else = true v]+ - :: control
Last edited by ihavenocluewhythisis (May 14, 2024 20:47:25)
- Discussion Forums
- » Suggestions
-
» Elif (else-if) block