Discuss Scratch
- Discussion Forums
- » Suggestions
- » Add the conditional operator, a condensed if/else
- Codingfairy07
- Scratcher
500+ posts
Add the conditional operator, a condensed if/else
The link doesn't work.As Sheep_Maker has pointed out, this is a Support. This could be so useful for 1LCs.duplicate. Please continue the discussion there.
Last edited by Codingfairy07 (June 25, 2021 16:04:14)
(φ゜▽゜*♪) :: sensing // This is Laura, my kumquat guard who never sleeps. Sleeping is for amateur Kumquat guards.Announcement
;
- DJUmbreon2
- Scratcher
100+ posts
Add the conditional operator, a condensed if/else
I support, even tho I have a block of that type on my profileA better way to do that would just be to add custom reporters (Sratch Team, please)< if <>, then [] else [] :: control>
If they dont come, SupportWHAT?? No Support, thats litterly justIf <>, then ((::stack control) :: grey ring), else ((::stack control) :: grey ring)::controlif <> then
else
endtoo easy of a workaround without much usefulness, No Support<if <>, then <> else<> :: control>
(Also, its kinda redundant with the reporter thingy)<<<if> and <Input then>> or <<not <if>> and <Input else>>>
- orangetheory
- Scratcher
500+ posts
Add the conditional operator, a condensed if/else
I think this would be very useful - it is a quicker way but does the same things as the if else block…. But I'm saying, you have my support!
-Frisbee- -Cricket--Basketball--Forums--Mapping--Coding--Trigonometry master--Mathematics King--Future Prime Minister--Intro-Maker-
I know HTML/CSS, and JavaScript, and with these coding skills I have made some decent projects! Test them out below!
~Archery~Cops + Robbers~
Want an intro, outro, music, effects, or more? Check out the intro shop!
The forum helpers, a place where we help people in the forums
- cyleja1234
- Scratcher
3 posts
Add the conditional operator, a condensed if/else
((<(foo) < [1]>*(1.5))+(2))basically if foo is less then 1 it will return 3.5 else it will return 2
the Boolean operator will turn to 1 if true 0 if false so lets say that the Boolean is false then:
0 * 1.5 = 0 so 0 + 2 =2
but if it is true then:
1 * 1.5 = 1.5 so 1.5 + 2 =3.5
hope this helps!
- cyleja1234
- Scratcher
3 posts
Add the conditional operator, a condensed if/else
((<(foo) < [1]>*(1.5))+(2))basically if foo is less then 1 it will return 3.5 else it will return 2
the Boolean operator will turn to 1 if true 0 if false so lets say that the Boolean is false then:
0 * 1.5 = 0 so 0 + 2 =2
but if it is true then:
1 * 1.5 = 1.5 so 1.5 + 2 =3.5
hope this helps!
also this will help for stuff like sprint and stamina, if stamina is not 0 and you are holding the sprint key it will move 3.5 in the x direction else move 2 in the x direction.
- Discussion Forums
- » Suggestions
- » Add the conditional operator, a condensed if/else