Discuss Scratch

medians
Scratcher
1000+ posts

Elif (else-if) block

qwerty_wasd_gone wrote:

if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}+::control
there should be this plus sign at the bottom
if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}@delInput @addInput::control

if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}@delInput @addInput else {
} ::control
@delInput
@addInput

Last edited by medians (Dec. 22, 2022 00:47:51)

kingcapybaradev
New Scratcher
9 posts

Elif (else-if) block

mathfreak231 wrote:

(sorry for abrupt edit but my opinions have changed and because i am one of the first few posters i need to look good)

Don't call it “elif”, just because it's used in Python doesn't mean the name won't be confusing.
The block (renamed) may just work but maybe it will be too cluttering with the “+”s? It's useful but will require reorganization…
bruh they can say elif chill
Knightbot63
Scratcher
1000+ posts

Elif (else-if) block

Sooo
Like python with elif's?
Well, I do like it but the workaround tho
if <> then 



else
if <> then

end
end
Though I'm not copying and pasting tons of if thens and I think this can be useful for better organizations.
So support for the reasons I stated above.
hill_walker123
Scratcher
100+ posts

Elif (else-if) block

medians wrote:

qwerty_wasd_gone wrote:

if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}+::control
there should be this plus sign at the bottom
if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}@delInput @addInput::control

if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}@delInput @addInput else {
} ::control
@delInput
@addInput
if <> then 



else
if <> then



else
if <> then



else

end
end
end
PkmnQ
Scratcher
1000+ posts

Elif (else-if) block

hill_walker123 wrote:

if <> then 



else
if <> then



else
if <> then



else

end
end
end
99 levels of nesting vs long block
NeonG4
Scratcher
1000+ posts

Elif (else-if) block

I don't get why you would want an elif. Just do a if, else if.
An0therRand0mC0der
Scratcher
1000+ posts

Elif (else-if) block

NeonG4 wrote:

(#267)
I don't get why you would want an elif. Just do a if, else if.

frdsaw wrote:

so you don't have to have numerous else and if blocks.
medians
Scratcher
1000+ posts

Elif (else-if) block

NeonG4 wrote:

I don't get why you would want an elif. Just do a if, else if.
Because you have to drag out thousands of if else if blocks or keep duplicating them instead of just clicking a button that adds it faster. Also a lot of programming languages have else if statements.
GoodGoldlyJesus
Scratcher
56 posts

Elif (else-if) block

medians wrote:

qwerty_wasd_gone wrote:

if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}+::control
there should be this plus sign at the bottom
if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}@delInput @addInput::control

if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}else if<>then{
}@delInput @addInput else {
} ::control
@delInput
@addInput

that's basically
if <> then 



else
if <> then



else
if <> then



else
if <> then



else

end
end
end
end
run ({
say [Hello]
wait (1) secs
say [World!]
} @addInput :: grey ring) @addInput :: control
when  :: control hat
run all at once when <button (@greenFlag ::#2aa1c9) hold for (3) seconds ::#2aa1c9> { 
drink monster energy drink ::#c99c2a
}

Last edited by GoodGoldlyJesus (Feb. 16, 2023 13:49:24)

NeonG4
Scratcher
1000+ posts

Elif (else-if) block

medians wrote:

NeonG4 wrote:

I don't get why you would want an elif. Just do a if, else if.
Because you have to drag out thousands of if else if blocks or keep duplicating them instead of just clicking a button that adds it faster. Also a lot of programming languages have else if statements.
But you really shouldn't have “thousands of elif” statements. Sure, its laggy. But so is 1 block. I'm voting against this because you really don't need it.
owlover2010
Scratcher
100+ posts

Elif (else-if) block


if <> {


} elif <> {


} else ::control
scratchyGabby6
Scratcher
100+ posts

Elif (else-if) block

scimonster wrote:

(#8)

mathfreak231 wrote:

First of all, nobody calls it Elif. It's “elseif” or “else if”.
Python users do, as that's the name of the Python keyword.

What's wrong with simply stacking if/elses?
if <...> then
...
else
if <...> then
...
else
if <...> then
...
else
if <...> then
...
else
...
this is simpler and less ‘big’
if <> then {

} else if <> then @delInput{

} else @delInput{

}@addInput:: control

Last edited by scratchyGabby6 (March 4, 2023 02:35:12)

gdfsgdfsgdfg
Scratcher
1000+ posts

Elif (else-if) block

Thats a pain in the butt

what happens if you have 100 else if statements
medians
Scratcher
1000+ posts

Elif (else-if) block

gdfsgdfsgdfg wrote:

Thats a pain in the butt

what happens if you have 100 else if statements
And what if you have 100 nested ifs (like you have to do now)?
fvewg
New Scratcher
44 posts

Elif (else-if) block

The workaround can be easily done in a seconds, it won't bother anyone if you stack 100 block up each others, that's literally what Scratch is. This couldn't really do anything rather than closing the door for the more worthy blocks to be added, and it literally have the same case as the rejected forever if block.
scratchyGabby6
Scratcher
100+ posts

Elif (else-if) block

fvewg wrote:

The workaround can be easily done in a seconds, it won't bother anyone if you stack 100 block up each others, that's literally what Scratch is. This couldn't really do anything rather than closing the door for the more worthy blocks to be added, and it literally have the same case as the rejected forever if block.
Replace the if else block with this one
medians
Scratcher
1000+ posts

Elif (else-if) block

guifernandes
Scratcher
49 posts

Elif (else-if) block

edit: nvm im stupid

Last edited by guifernandes (March 23, 2023 00:44:00)

Elijah999999
Scratcher
1000+ posts

Elif (else-if) block

As in:
if <> then 



else
if <> then



else
if <> then



else
if <> then



else

end
end
end
end
?

Last edited by Elijah999999 (March 23, 2023 00:51:56)

medians
Scratcher
1000+ posts

Elif (else-if) block

Elijah999999 wrote:

As in:
long chain ::grey
?
Yes, except it would look like this:
if <> then {

} else if <> then {

} else if <> then {

} else if <> then {

} else @delInput @addInput {

}::control

Powered by DjangoBB