Discuss Scratch

mica43683
Scratcher
500+ posts

Either/Or block

WindOctahedron wrote:

mica43683 wrote:

WindOctahedron wrote:

-snip-
Wouldn't
<(variable) > [7]>
also be greater than 5?
Oh, yes. I meant
set [variable v] to (pick random (1) to (8))
if <(variable) < [5]> then // prob. 1/2
...
else
if <(variable) < [7]> then // prob. 1/4
...
else

if <(variable) = [7]> then // both prob. 1/8
...

else // prob. 1/8
...
end
end
end
Thanks for pointing that out.
< 5 would also be < 7
scratchblocks]
set [variable v] to (pick random (1) to (8))
if <(variable) < [5]> then // 1/2. Being < 5 would mean it would be 1,2,3 or 4. If it wasn't one of those, it must be higher.
...
else
if <<(variable) > [4]> and <(variable) < [7]>> then // 1/4. This would make it either 5 or 6. In your script, it was made in a way that 5 could
... // never be chosen, because it would always be either > 5 or < 5, but never = 5.
else
if <(variable) = [7]> then // both 1/8
...
else
...
end
end
end
Troyer_Kem
Scratcher
1000+ posts

Either/Or block

No Support. You can use the list for a random reaction.
when green flag clicked
add [Hehe!] to [list v]
add [That tickles!] to [list v]
add [I feel so happy!] to [list v]

when green flag clicked
forever
if <touching [mouse pointer v] ?> then
say (item (pick random (1) to (3)) of [list v] :: list) for (2) secs
wait until <not <touching [mouse pointer v] ?>>
end
end
mica43683
Scratcher
500+ posts

Either/Or block

Troyer_Kem wrote:

No Support. You can use the list for a random reaction.
when green flag clicked
add [Hehe!] to [list v]
add [That tickles!] to [list v]
add [I feel so happy!] to [list v]

when green flag clicked
forever
if <touching [mouse pointer v] ?> then
say (item (pick random (1) to (3)) of [list v] :: list) for (2) secs
wait until <not <touching [mouse pointer v] ?>>
end
end
This would only choose different things to say, not different outcomes.

Last edited by mica43683 (June 28, 2019 09:56:02)

BlueStarPort
Scratcher
100+ posts

Either/Or block

Semi-Support. The workaround is pretty easy, but this might benefit people with less knowledge of coding.
Troyer_Kem
Scratcher
1000+ posts

Either/Or block

mica43683 wrote:

Troyer_Kem wrote:

No Support. You can use the list for a random reaction.
when green flag clicked
add [Hehe!] to [list v]
add [That tickles!] to [list v]
add [I feel so happy!] to [list v]

when green flag clicked
forever
if <touching [mouse pointer v] ?> then
say (item (pick random (1) to (3)) of [list v] :: list) for (2) secs
wait until <not <touching [mouse pointer v] ?>>
end
end
This would only choose different things to say, not different outcomes.
Oh okay then.
mica43683
Scratcher
500+ posts

Either/Or block

Bump
mica43683
Scratcher
500+ posts

Either/Or block

Bump
mica43683
Scratcher
500+ posts

Either/Or block

Bump
mica43683
Scratcher
500+ posts

Either/Or block

Bump
mica43683
Scratcher
500+ posts

Either/Or block

Bump
Truck11111
Scratcher
1000+ posts

Either/Or block

mica43683 wrote:

Bump

mica43683 wrote:

Bump

mica43683 wrote:

Bump

mica43683 wrote:

Bump

mica43683 wrote:

Bump
404 error?
mica43683
Scratcher
500+ posts

Either/Or block

Truck11111 wrote:

mica43683 wrote:

Bump

mica43683 wrote:

Bump

mica43683 wrote:

Bump

mica43683 wrote:

Bump

mica43683 wrote:

Bump
404 error?
Yup. I tried to post it only once or twice yesterday, but it posted a million times.
WindOctahedron
Scratcher
1000+ posts

Either/Or block

mica43683 wrote:

WindOctahedron wrote:

-snip-
< 5 would also be < 7
Yes, it would, but the “if x, then y, else z” is equivalent to "if x, then y; if not x, then z". Here, z = if a, then b. So it checks if a number is less than 5, and if not, checks if it is at least less than 7.

Last edited by WindOctahedron (June 29, 2019 13:50:22)

Dilek10
Scratcher
100+ posts

Either/Or block

You mean a new logic gate? Um, sure. I'm gonna support.
WindOctahedron
Scratcher
1000+ posts

Either/Or block

Dilek10 wrote:

You mean a new logic gate? Um, sure. I'm gonna support.
No, it's not a logic gate. It's a block that allows random outcomes.
Zelmore
New Scratcher
1 post

Either/Or block

Hi
Madcatofdoom
Scratcher
500+ posts

Either/Or block

Zelmore wrote:

Hi
Hi! Welcome to Scratch, as well as the Scratch Forums! You just posted “Hi”, which isn't exactly a good thing, because it's quite irrelevant to this thread, but if you like the word hi, you can say that in the “New Scratchers” forum here! People are very nice there and will reply with more “hi”s than you can ever think of!
Tiger_Person
Scratcher
100+ posts

Either/Or block

Semi support: I really have no opinion on this, but I do think this is a good block for less experienced people, and for people who just want to make things simpler, but the workaround is just fine for me.
the2000
Scratcher
1000+ posts

Either/Or block

Tiger_Person wrote:

Semi support: I really have no opinion on this, but I do think this is a good block for less experienced people, and for people who just want to make things simpler, but the workaround is just fine for me.
I don't think we should have many blocks just to “make things simpler”. They're going to need to learn the workarounds eventually, so we might as well teach it early on.
cruncherBones
Scratcher
500+ posts

Either/Or block

It has a es workaround but I support as it is a cool block I like it

Powered by DjangoBB