Discuss Scratch

Tymewalk
Scratcher
1000+ posts

Elif (else-if) block

liam48D wrote:

Support unless zebra-colouring is added.

What is “zebra-coloring”? If by that you mean everything's going to be a different color, then no, it will all be the same color.
stickfiregames
Scratcher
1000+ posts

Elif (else-if) block

Tymewalk wrote:

liam48D wrote:

Support unless zebra-colouring is added.

What is “zebra-coloring”? If by that you mean everything's going to be a different color, then no, it will all be the same color.

This is zebra colouring - it alternates the colours of nested blocks (shown on the control and operators blocks here) to make them easier to differentiate.
DaSpudLord
Scratcher
1000+ posts

Elif (else-if) block

stickfiregames wrote:

Tymewalk wrote:

liam48D wrote:

Support unless zebra-colouring is added.

What is “zebra-coloring”? If by that you mean everything's going to be a different color, then no, it will all be the same color.

This is zebra colouring - it alternates the colours of nested blocks (shown on the control and operators blocks here) to make them easier to differentiate.
No support, unless it's optional.
IronBit_Studios
Scratcher
1000+ posts

Elif (else-if) block

JamesOuO wrote:

It doesn't get messy, eh?

This is the actual code for a custom tile render I made
Definite support.
Nether_before
Scratcher
1000+ posts

Elif (else-if) block

Support as while it may not be “messy”, it's really annoying to look at all those if else's. It just looks a bit silly.
Vetpetmon
Scratcher
1000+ posts

Elif (else-if) block

JamesOuO wrote:

It doesn't get messy, eh?

This is the actual code for a custom tile render I made
Definite support.
Wish I had the gif ready… REASON: My browser / operating system: Windows 7, Firefox 38.0, Flash 17.0 (release 0) (My Mac is the main OS )

Support.
A-no-meep
Scratcher
100+ posts

Elif (else-if) block

DaSpudLord wrote:

rollercoasterfan wrote:

JamesOuO wrote:

It doesn't get messy, eh?
Image hidden. View it here- http://i.cubeupload.com/Iyldpr.png
This is the actual code for a custom tile render I made
Definite support.
That's not very messy.
The only “mess” I see is a bit of extra space taken up. Other than that, looks clean as a whistle to me.

Even though it may just be extra space taken up, getting the space back would declutter the coding area. I support this idea.
Tymewalk
Scratcher
1000+ posts

Elif (else-if) block

DaSpudLord wrote:

stickfiregames wrote:

Tymewalk wrote:

liam48D wrote:

Support unless zebra-colouring is added.

What is “zebra-coloring”? If by that you mean everything's going to be a different color, then no, it will all be the same color.

This is zebra colouring - it alternates the colours of nested blocks (shown on the control and operators blocks here) to make them easier to differentiate.
No support, unless it's optional.

I don't see why zebra coloring would be useful here, the if/else if/else is just all one big block, and there's no nesting.
Detriment2
New Scratcher
100+ posts

Elif (else-if) block

rollercoasterfan wrote:

Tymewalk wrote:

ChocolatePi wrote:

Other languages (other than Python, ick) don't have this feature. Using an “else if” conditional would be the same as doing else then a line break then an if. I don't think Scratch needs this, although I would like a switch structure.

I know that you could use a combination of else and if to get the same thing, but a lot of projects that use this usually use a lot - causing a bunch of nasty nested blocks that tend to get out of hand. The “else if” block would help fix this and keep it ordered.
No, it doesn't get very messy. No support.
It's not messy more like it doesn't contribute anything and is pretty much spam
chuckdaboss
Scratcher
100+ posts

Elif (else-if) block

Support for either elseif, or zebra stripes.
Zebra stripes:
if <> then
else
if <> then::variables
else
if <> then
else
if <> then::variables
else
if <> then
else
end
Detriment2
New Scratcher
100+ posts

Elif (else-if) block

I can't edit my post, I accidentally submitted it before finishing typing out what I was saying

You can use if blocks in a chain to do else ifs, even if this block would be added, you'd really only have if elseif and else, so if you needed more than 2 elseifs you'd have to nest more blocks into it, so why not just nest more ifs together instead of making a whole new block?
Tymewalk
Scratcher
1000+ posts

Elif (else-if) block

Detriment2 wrote:

I can't edit my post, I accidentally submitted it before finishing typing out what I was saying

You can use if blocks in a chain to do else ifs, even if this block would be added, you'd really only have if elseif and else, so if you needed more than 2 elseifs you'd have to nest more blocks into it, so why not just nest more ifs together instead of making a whole new block?

There would be a plus sign to add more else-ifs, like this:
if <> then
example
else if <> :: celse
another example
else if <> (+) :: celse
that plus sign adds a new elseif
else
plus sign is always on the last elseif
end

and this would avoid having to nest ifs together.
MegaApuTurkUltra
Scratcher
1000+ posts

Elif (else-if) block

ChocolatePi wrote:

Other languages (other than Python, ick) don't have this feature. Using an “else if” conditional would be the same as doing else then a line break then an if. I don't think Scratch needs this, although I would like a switch structure.
This. The workaround is easy. However, a switch block would be awesome

Last edited by MegaApuTurkUltra (May 26, 2015 16:34:19)

Tymewalk
Scratcher
1000+ posts

Elif (else-if) block

Bump.
invisibowl
Scratcher
23 posts

Elif (else-if) block

JamesOuO wrote:

It doesn't get messy, eh?

This is the actual code for a custom tile render I made
Definite support.
You don't need any of those else statements there except the last one, since If blocks automatically get skipped over if they're false. You don't even have anything in the last Else, so it's literally the exact same thing as a regular If statement.

I sort of support this. You never ever need more than one else-if in a conditional; if you do, you also need to rework your code (this applies to any language, not just Scratch).

Last edited by invisibowl (May 30, 2015 00:17:12)

stickfiregames
Scratcher
1000+ posts

Elif (else-if) block

invisibowl wrote:

JamesOuO wrote:

It doesn't get messy, eh?
-snip-
This is the actual code for a custom tile render I made
Definite support.
You don't need any of those else statements there except the last one, since If blocks automatically get skipped over if they're false. You don't even have anything in the last Else, so it's literally the exact same thing as a regular If statement.

I sort of support this. You never ever need more than one else-if in a conditional; if you do, you also need to rework your code (this applies to any language, not just Scratch).
It's possible for a sprite to be touching more than one colour at once, so if it was done with just ifs it might add the position to more than one list. In this particular example it is probably set up so that the sensing sprite is only touching one colour, but other projects might use a script similar to that and be touching many colours, so they would need if/elses.
Gaza101
Scratcher
500+ posts

Elif (else-if) block

Support. I've never understood why this wasn't added in the first place.
spike43884
Scratcher
79 posts

Elif (else-if) block

Ehh. the ifelseifelse would get messy to.
if <> then

else if <> then :: celse

else if <> then :: celse

else if <> then :: celse

else if <> then :: celse

else if <> then :: celse

else if <> then :: celse

else if <> then :: celse

else if <> then :: celse

else if <> then :: celse

else if <> then :: celse

else if <> then :: celse

else if <> then :: celse

else if <> then :: celse

else if <> then :: celse

else if <> then :: celse

else if <> then :: celse

else if <> then :: celse

else if <> then :: celse

else if <> then :: celse

else if <> then :: celse

else if <> then :: celse

else

end

especially with the little + and -

Last edited by spike43884 (May 30, 2015 13:05:38)

emeralddog
Scratcher
100+ posts

Elif (else-if) block

JoeyTheChicken wrote:

No support means he doesn't think it's a good idea. Honestly, I don't like the system we use around here. “No support” always comes off sounding way more harsh than it should. If I don't think Scratch should have something, I simply explain why I think that. And I can see where this would be handy if you were getting really cluttered
same with me in my forum, it is never nice to hear “No support” if I don't like a book, I don't write to the author and say “I don't like it” I keep my opinion to myself.
Birdlegs
Scratcher
1000+ posts

Elif (else-if) block

emeralddog wrote:

JoeyTheChicken wrote:

No support means he doesn't think it's a good idea. Honestly, I don't like the system we use around here. “No support” always comes off sounding way more harsh than it should. If I don't think Scratch should have something, I simply explain why I think that. And I can see where this would be handy if you were getting really cluttered
same with me in my forum, it is never nice to hear “No support” if I don't like a book, I don't write to the author and say “I don't like it” I keep my opinion to myself.
A little different, though. Here, no support is around because the nature of the forum demands it. I just think it often comes off sounding cold and mean

Powered by DjangoBB