Discuss Scratch

KittyCatGames156
Scratcher
22 posts

if else reporter

I was thinking of having a
(if <> [] else [])
reporter, like in Snap,or java's (boolean?object: object)
This block would return the first string if the condition is true, and the second if false.

It can make it easier to make strings with booleans.

Without blocks:

when green flag clicked
forever
set [say v] to [Mouse is: ]

if <mouse down?> then
set [say v] to (join (say) [down.])
else
set [say v] to (join (say) [up.])
end
say (say)
end

With blocks:

when green flag clicked
forever
say (join [Mouse is: ] (if <mouse down?> [down] else [up]))
end

 (all but letter () of [world])
seanbobe
Scratcher
500+ posts

if else reporter

too easy of a workaround. also new scratchers might not understand.
no support

Sadly my kumquat was eaten by an evil signature.
_______________
|My internets.…..|
\Kumquat Shield/
AonymousGuy
Scratcher
1000+ posts

if else reporter

if <condition :: grey> then
set [output v] to [val1]
else
set [output v] to [val2]
end
What's so hard about that?
KittyCatGames156
Scratcher
22 posts

if else reporter

Yes, it's kind of easy to do it that way, but this would be simpler for kids to understand, and be neater, IMO.

EDIT: Well it would be easier than doing that if set var else set var thing, which I think would be even harder for kids to understand, @seanbobe.

Last edited by KittyCatGames156 (June 7, 2014 16:14:56)


 (all but letter () of [world])
Sonickyle
Scratcher
1000+ posts

if else reporter

KittyCatGames156 wrote:

Yes, it's kind of easy to do it that way, but this would be simpler for kids to understand, and be neater, IMO.
Actually, I think it's the other way around.
if <> then
else

end
^ This is as simple as it can get.

No I don't make projects anymore. I left some time ago.
I only check the forums every now and then, but other than that consider me retired.
Braeden5454
Scratcher
500+ posts

if else reporter

It could be
say (join (join [it is] <mouse down?>) [that your mouse is down.])
Would say It os true that your mouse is down if it is, and “It is false that your mouse is down” If its not

No text here-> Haha April Fools, You spent 3 seconds highlighting this.
move () steps

If you think my post was helpful, you may want to Follow me to receive updated and useful tips.
I am raeden5454. You can check out some more projects at My Prof
404 Error. Cannot find page “signature”. Reason: Kumquat consumption
wkelly42
Scratcher
100+ posts

if else reporter

If you're talking about making something easier, then it might be easier the way you propose. But if you're talking about teaching people to code, and using proper syntax and coding techniques, then the way it already is is better.

I'm more interested in the latter, so no support.

My Retro Arcade:
COMPLETED: Frogger, Missile Command, Computer Space.
IN DEVELOPMENT: Barnstorming, Time Pilot, Defender, River Raid, Karateka
mathfreak231
Scratcher
1000+ posts

if else reporter

wkelly42 wrote:

But if you're talking about teaching people to code, and using proper syntax and coding techniques, then the way it already is is better.
Au contraire:
in Python:
this if condition else that
in Ruby:
condition?this:that
And much more.

However, I really don't support, as the workaround is still sufficient.

i have grown as a person. and ive grown, literally. none of my posts from before 2022 represent me accurately.

Powered by DjangoBB