Discuss Scratch
- Discussion Forums
- » Suggestions
- » Elif (else-if) block
- Codingfairy07
-
500+ posts
Elif (else-if) block
No support, super easy workaround [offtopic](“elif” is the name for a letter in Arabic)[/offtopic]
Last edited by Codingfairy07 (Aug. 5, 2021 15:24:59)
- Maximouse
-
1000+ posts
Elif (else-if) block
The purpose of this suggestion is to make code cleaner, not to make anything easier. No support, super easy workaround [offtopic](“elif” is the name for a letter in Arabic)[/offtopic]
- AlfabetonsOfficial
-
100+ posts
Elif (else-if) block
Support, putting many if-else blocks could be chunky and I don't know where is where anymore.
- ScolderCreations
-
1000+ posts
Elif (else-if) block
Support. Maybe we could customize how many else if's would be in the block?
- SmartCat3
-
500+ posts
Elif (else-if) block
In my case it would save hoursThe purpose of this suggestion is to make code cleaner, not to make anything easier. No support, super easy workaround [offtopic](“elif” is the name for a letter in Arabic)[/offtopic]
- Buhron8312480
-
100+ posts
Elif (else-if) block
Support all of ypur are worng
if <> then {
}elif <> {
}:: control
[/scratchblocks
- han614698
-
1000+ posts
Elif (else-if) block
Mock-up
if <> then{
}elif <>{
} @delInput @addInput::control
- hiPeeps124816
-
500+ posts
Elif (else-if) block
support, i hate nesting if else blocks
maybe add an option to set how much else ifs or if then else if then else?
maybe add an option to set how much else ifs or if then else if then else?
if <> then {
} else if <> then {
} else {
} :: control
- SuperMarioHome
-
100+ posts
Elif (else-if) block
Support.
My idea would be to give the ‘if <> then, else’ block input arrows (but vertical). Clicking the down arrow would make these:`
Clicking the up arrow would reverse this.
Please bump this as it seems like a good idea.
if <> then {
} else {
} ▼ :: control
My idea would be to give the ‘if <> then, else’ block input arrows (but vertical). Clicking the down arrow would make these:`
if <> then {and so on.
} else, if <> then {
} else {
} ▼▲ :: control
if <> then {
} else, if <> then {
} else, if <> then {
} else {
} ▼▲ :: control
Clicking the up arrow would reverse this.
Please bump this as it seems like a good idea.
Last edited by SuperMarioHome (Aug. 20, 2021 07:09:09)
- Reev0102
-
1000+ posts
Elif (else-if) block
Support. This would make code a lot shorter. However, “elif” should be renamed to “else if”, because “elif” might confuse New Scratchers.
This feature exists in JavaScript, Python and a lot of other programming languages..
This feature exists in JavaScript, Python and a lot of other programming languages..
if <> then {
} else if <> {
} else if <> {
} else {
} ▼▲ :: control
Last edited by Reev0102 (Sept. 8, 2021 03:07:45)
- Vaibhs11
-
1000+ posts
Elif (else-if) block
Support. This would make code a lot shorter. However, “elif” should be renamed to “else if”, because “elif” might confuse New Scratchers.Because it exists in C.
This feature exists in JavaScript and Python.
- Reev0102
-
1000+ posts
Elif (else-if) block
Why are you C'ing me so much?Support. This would make code a lot shorter. However, “elif” should be renamed to “else if”, because “elif” might confuse New Scratchers.Because it exists in C.
This feature exists in JavaScript and Python.
- Unithlees3
-
1000+ posts
Elif (else-if) block
because c /hjWhy are you C'ing me so much?Support. This would make code a lot shorter. However, “elif” should be renamed to “else if”, because “elif” might confuse New Scratchers.Because it exists in C.
This feature exists in JavaScript and Python.
- han614698
-
1000+ posts
Elif (else-if) block
How about?
if <> then{
}else{
}end @delInput @addInput::control
Last edited by han614698 (Oct. 29, 2021 21:28:06)
- han614698
-
1000+ posts
Elif (else-if) block
meant to hit “go back”
Last edited by han614698 (Oct. 29, 2021 21:31:50)
- medians
-
1000+ posts
Elif (else-if) block
I. Am. Done.because c /whyWhy are you C'ing me so much?Support. This would make code a lot shorter. However, “elif” should be renamed to “else if”, because “elif” might confuse New Scratchers.Because it exists in C.
This feature exists in JavaScript and Python.
yesss How about?if <> then{
}else{
}end @delInput @addInput::control
if <> then{
}else if <> {
} else {
} end @delInput @addInput::control
- Inkay1954
-
75 posts
Elif (else-if) block
I have long abandoned this suggestion since I left Scratch.
I'm back now, and I'm proud to say that we definitely need this. If you put too many if-else blocks inside of each other, it's hard to find out where is where.
Also, yes, we should rename it to else if because this is hard to understand for some and also because elif is said to be an Arabic word or something…
Thank you for supporting when I wasn't there.
I'm back now, and I'm proud to say that we definitely need this. If you put too many if-else blocks inside of each other, it's hard to find out where is where.
Also, yes, we should rename it to else if because this is hard to understand for some and also because elif is said to be an Arabic word or something…
Thank you for supporting when I wasn't there.
- dave-alt-4
-
1000+ posts
Elif (else-if) block
this :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?
-snip-
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
if <touching color [#000000] ?> then
change x by (1)
else
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
- banana439monkey
-
1000+ posts
Elif (else-if) block
elif improves code efficiency, highly useful and cuts down on the insane amount of code. imo, it should work like this
Banana
if <condition :: sensing> then {Maybe UX could design something that would signify that the second C is for elif statements only? This is all hypothetical and it's not nearly perfect but it decently portrays the idea.
action :: custom
} {
else if <condition :: sensing> {
action :: custom
} :: control
else if <condition :: sensing> {
and repeat etc for however many conditions :: custom
} :: control
} else {
action :: custom
} :: control
Banana