Discuss Scratch

Codingfairy07
Scratcher
500+ posts

Add the conditional operator, a condensed if/else

Queer_Royalty wrote:

M4- wrote:

Support. This could be so useful for 1LCs.
As Sheep_Maker has pointed out, this is a duplicate. Please continue the discussion there.
The link doesn't work.

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

ShinigamiBlacky wrote:

red_king_cyclops wrote:

< if <>, then [] else [] :: control>
A better way to do that would just be to add custom reporters (Sratch Team, please)
If they dont come, Support

red_king_cyclops wrote:

If <>, then ((::stack control) :: grey ring), else ((::stack control) :: grey ring)::control
WHAT?? No Support, thats litterly just
if <> then 
else
end

red_king_cyclops wrote:

<if <>, then <> else<> :: control>
too easy of a workaround without much usefulness, No Support
(Also, its kinda redundant with the reporter thingy)
<<<if> and <Input then>> or <<not <if>> and <Input else>>>
I support, even tho I have a block of that type on my profile

Check out my OC and Outro.
set [studio update support v] to [NO U ST]
DJUmbreon2
Scratcher
100+ posts

Add the conditional operator, a condensed if/else

I have custom blocks for the reporter, but support
if <> then (:: control stack) else (:: control stack) :: control
You thief, that’s the
if <> then 



else

end
Block
Idk bout the boolean

Last edited by DJUmbreon2 (June 28, 2021 15:13:56)


Check out my OC and Outro.
set [studio update support v] to [NO U ST]
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

cyleja1234 wrote:

((<(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.

Powered by DjangoBB