Discuss Scratch

HTML_JAVASCRIPT_CSS
Scratcher
100+ posts

"if () then () else ()" control block.

ipaddude wrote:

idk
it would seem kinda cool

it's built into javascript and probably wouldn't be very hard to implement (
some_boolean?"the boolean is true":"the boolean is false"
)

maybe it could be like this
(if <some condition::operators> then [value 1] otherwise [value 2]::operators)

ik it would be confusing to new scratchers but they wouldnt even need to touch it
it's just a convenient shorthand
The tenary operator?
MDCCCLXVII
Scratcher
1000+ posts

"if () then () else ()" control block.

Another merged suggestion, another duplicate.

XDBoatUser wrote:

if <In Good Mood> then 
Imagine :pink:



else

end
Don't block-spam, even in duplicate topics.

Last edited by MDCCCLXVII (Dec. 22, 2020 01:27:59)

MDCCCLXVII
Scratcher
1000+ posts

"if () then () else ()" control block.

time to bump a non-duplicate

get this now

Last edited by MDCCCLXVII (March 13, 2021 01:00:28)

han614698
Scratcher
1000+ posts

"if () then () else ()" control block.

MDCCCLXVII wrote:

time to bump
Please don't bump a dupe.
lordibel
Scratcher
1000+ posts

"if () then () else ()" control block.

portalpower wrote:

please stop blockspamming
bruh…
Scratchperson1000000
Scratcher
500+ posts

"if () then () else ()" control block.

actually, now that I think about it, it COULD be useful, for example:
define factorial (n)
set [factorial v] to (if <(n) = (0)> then (1) else ((n) * ((n) - (1))) mod ((n) - (1)) :: operators)
to me, this workaround doesn't really matter anymore!:
if <> then
else
now that i've changed my mind. i say support.
MDCCCLXVII
Scratcher
1000+ posts

"if () then () else ()" control block.

Scratchperson1000000 wrote:

define factorial (n)
set [factorial v] to (if <(n) = (0)> then (1) else ((n) * ((n) - (1))) mod ((n) - (1)) :: operators)
to make this work you need custom reporters as well
Scratchperson1000000
Scratcher
500+ posts

"if () then () else ()" control block.

MDCCCLXVII wrote:

Scratchperson1000000 wrote:

define factorial (n)
set [factorial v] to (if <(n) = (0)> then (1) else ((n) * ((n) - (1))) mod ((n) - (1)) :: operators)
to make this work you need custom reporters as well
No you don't
MDCCCLXVII
Scratcher
1000+ posts

"if () then () else ()" control block.

Scratchperson1000000 wrote:

MDCCCLXVII wrote:

Scratchperson1000000 wrote:

define factorial (n)
set [factorial v] to (if <(n) = (0)> then (1) else ((n) * ((n) - (1))) mod ((n) - (1)) :: operators)
to make this work you need custom reporters as well
No you don't
yes you do, because the function will need to contain
((n) * (factorial ((n) - (1)) :: custom))
Scratchperson1000000
Scratcher
500+ posts

"if () then () else ()" control block.

MDCCCLXVII wrote:

Scratchperson1000000 wrote:

MDCCCLXVII wrote:

Scratchperson1000000 wrote:

define factorial (n)
set [factorial v] to (if <(n) = (0)> then (1) else ((n) * ((n) - (1))) mod ((n) - (1)) :: operators)
to make this work you need custom reporters as well
No you don't
yes you do, because the function will need to contain
((n) * (factorial ((n) - (1)) :: custom))
I never put that apart of the definition script I NEVER SAID THAT THE FACTORIAL THING WOULD BE A REPORTER
Do you even see me trying to put a factorial reporter? NO. Because I didn't want to
the2000
Scratcher
1000+ posts

"if () then () else ()" control block.

MDCCCLXVII wrote:

Scratchperson1000000 wrote:

define factorial (n)
set [factorial v] to (if <(n) = (0)> then (1) else ((n) * ((n) - (1))) mod ((n) - (1)) :: operators)
to make this work you need custom reporters as well
No, you wouldn't, because they're using the “call the block beforehand and make it update an output variable” workaround. Though yes, those would be nice.
samurai_master123
Scratcher
100+ posts

"if () then () else ()" control block.

Why is everyone here clueless? This is a 5 year old topic! Even helpful scratchers with 1000+ posts haven't seen that this is 5 years old! DON'T NECROPOST!!!
9gr
Scratcher
1000+ posts

"if () then () else ()" control block.

portalpower wrote:

please stop blockspamming
Its not blockspamming its the person trying to give a workaround/howd it look.
9gr
Scratcher
1000+ posts

"if () then () else ()" control block.

samurai_master123 wrote:

Why is everyone here clueless? This is a 5 year old topic! Even helpful scratchers with 1000+ posts haven't seen that this is 5 years old! DON'T NECROPOST!!!
Suggestions can be necroposted on because they may be coming from a new dupe. Also, people may want to support/give workarounds.
Scratchperson1000000
Scratcher
500+ posts

"if () then () else ()" control block.

samurai_master123 wrote:

Why is everyone here clueless? This is a 5 year old topic! Even helpful scratchers with 1000+ posts haven't seen that this is 5 years old! DON'T NECROPOST!!!
you cant necropost in the suggestions forum lol
gosoccerboy5
Scratcher
1000+ posts

"if () then () else ()" control block.

Why was the old ternary operator topic dustbinned? Was it a dupe of this one? They could have at least merged it
DualPikachu
Scratcher
100+ posts

"if () then () else ()" control block.

We already have the
if <> then 



else

end
block. And what stuff were supposed to be in the inputs? No support.
the2000
Scratcher
1000+ posts

"if () then () else ()" control block.

samurai_master123 wrote:

Why is everyone here clueless? This is a 5 year old topic! Even helpful scratchers with 1000+ posts haven't seen that this is 5 years old! DON'T NECROPOST!!!
Why does the age of the topic matter? Is the suggestion immediately invalid because it was made five years ago?
MDCCCLXVII
Scratcher
1000+ posts

"if () then () else ()" control block.

gosoccerboy5 wrote:

Why was the old ternary operator topic dustbinned? Was it a dupe of this one? They could have at least merged it
it's a mystery
gosoccerboy5
Scratcher
1000+ posts

"if () then () else ()" control block.

samurai_master123 wrote:

Why is everyone here clueless? This is a 5 year old topic! Even helpful scratchers with 1000+ posts haven't seen that this is 5 years old! DON'T NECROPOST!!!
Necroposting is defined as posting a long time after the last post, not the first. And, you can't really necropost in the suggestions forum

Powered by DjangoBB