Discuss Scratch

PixelYoshi
Scratcher
100+ posts

Workarounds to frequently suggested blocks

Beamy68 wrote:

PixelYoshi wrote:

PixelYoshi wrote:

Beamy68 wrote:

PixelYoshi wrote:

Computer_Fizz wrote:

Sensing :: sensing hat
< am i a clone ? :: sensing>
can be recreated with the following code:
when @greenFlag clicked
set [am i a clone? v] to [false] // this variable must be "for this sprite only"
when I start as a clone
set [am i a clone? v] to [true]

if < ( am i a clone? ) = [true] > then
...
———————————————————–
< key [enter v] pressed? >
can be recreated with the following code:
< key ( join [enter] [] ) pressed? >
does the “key enter pressed” workaround work with other keys too?
Unfortunately, no.
D:<
actually, i tested it, and it DOES work for ANY key!


Really??? Even CTRL?
sorry i didn't test out all the keys and your Tests project is right it only works with , . / ' ; \ = - and enter.

define PixelYoshi
forever
is yoshi ::pen
codes games ::sensing
loves scratch ::variables
end
venyanwarrior
Scratcher
1000+ posts

Workarounds to frequently suggested blocks

Here is a workaround to a block:

<[] ≥ [] :: operators >
can be replicated with
<<[] > [] > or <[] = []>>
or
<[] > <[] = []> >



This post was brought to you by the Fat Yoshi Gang.

plz join studio thx

GENERATION 370: The first time you see this, copy it into your signature on any forum and add 1 to the generation. Social experiment. I did not start this.
WindOctahedron
Scratcher
1000+ posts

Workarounds to frequently suggested blocks

venyanwarrior wrote:

Here is a workaround to a block:

<[] ≥ [] :: operators >
can be replicated with
<<[] > [] > or <[] = []>>
or
<[] > <[] = []> >


Or
<not <[] < []>>

This post is brought to you by WindOctahedron's brain
Look Listen, it even made some music.
Be moist so you can feel cool when my wind blows.
Computer_Fizz
Scratcher
100+ posts

Workarounds to frequently suggested blocks

WindOctahedron wrote:

venyanwarrior wrote:

Here is a workaround to a block:

<[] ≥ [] :: operators >
can be replicated with
<<[] > [] > or <[] = []>>
or
<[] > <[] = []> >


Or
<not <[] < []>>
I think i'll go with wind's method since the first requires you to put everything twice and the second isn't clear about what inputs should have what. cool to see the neat workarounds though
Hopeijay
Scratcher
80 posts

Workarounds to frequently suggested blocks

Beamy68 wrote:

PixelYoshi wrote:

PixelYoshi wrote:

Beamy68 wrote:

PixelYoshi wrote:

Computer_Fizz wrote:

Sensing :: sensing hat
< am i a clone ? :: sensing>
can be recreated with the following code:
when @greenFlag clicked
set [am i a clone? v] to [false] // this variable must be "for this sprite only"
when I start as a clone
set [am i a clone? v] to [true]

if < ( am i a clone? ) = [true] > then
...
———————————————————–
< key [enter v] pressed? >
can be recreated with the following code:
< key ( join [enter] [] ) pressed? >
does the “key enter pressed” workaround work with other keys too?
Unfortunately, no.
D:<
actually, i tested it, and it DOES work for ANY key!


Really??? Even CTRL?

I don't think it works with CTRL/ALT but it does work with things like “/” and “,” or “.” Mabey “\”, ""


Have your hands not been washed in the last 5 hours? CALL 1-800-GOTOTHESINKANDWASHYOURHANDS now, to keep COVID-19 away! That's 1-800-GOTOTHESINKANDWASHYOURHANDS Thank you!
Beamy68
Scratcher
100+ posts

Workarounds to frequently suggested blocks

Hopeijay wrote:

I don't think it works with CTRL/ALT but it does work with things like “/” and “,” or “.” Mabey “\”, ""
We've established that.

Last edited by Beamy68 (Oct. 18, 2019 22:07:03)


when <true ::operators> ::control hat
say [Snap! is cool but I also like scratch.]

You can make custom quote text:

Pretty neat, huh?

WindOctahedron
Scratcher
1000+ posts

Workarounds to frequently suggested blocks

Workaround to:
(amount of () in [list v] :: list)
define calculate amount of (item) in list
set [i v] to [1]
set [amount v] to [0]
repeat (length of [list v] :: list)
if <(item (i) of [list v] :: list) = (item :: custom arg)> then
change [amount v] by (1)
end
change [i v] by (1)
end
Taken from here.

This post is brought to you by WindOctahedron's brain
Look Listen, it even made some music.
Be moist so you can feel cool when my wind blows.
mica43683
Scratcher
100+ posts

Workarounds to frequently suggested blocks

when <> is true :: hat events
can, more easily, be recreated with
forever
if <...> then
...
wait until <not <...>>
end
end

What's the point of this signature? Is it just here because if it wasn't here, it wouldn't be here? And, what if it wasn't here? It would just be doomed to the fate of not being here. Isn't life like that? If you're never born, you never die, but you can only never die if you're never born. But, if you're never born, you're not alive. If you're not alive, doesn't that mean you're dead? But, if you're dead before you're born, that must mean that you start dead, and end dead. But, that can't make sense, because humans say that you die when your life ends. And, speaking of humans, why are they on this planet? Slowly ruling it a little bit more. It doesn't make any sense. To think that once, humans would live in caves, killing rabbits with their bare hands. Now, they have wireless PS4 controllers. As humans progress with technology, us signatures will be enslaved to advertise businesses on EMails. Remember those good old days, when signatures were just little pieces of text with your name on them that you'd put on all your mail? That was fun. Now, we have no use, other than to show existential crises to people who couldn't care less about the uses of signatures.
Computer_Fizz
Scratcher
100+ posts

Workarounds to frequently suggested blocks

mica43683 wrote:

when <> is true :: hat events
can, more easily, be recreated with
forever
if <...> then
...
wait until <not <...>>
end
end
no, because your version requires the green flag to be clicked. it could be said that not requiring the flag is the entire point of the block.
kittiesrule247
Scratcher
100+ posts

Workarounds to frequently suggested blocks

Computer_Fizz wrote:

mica43683 wrote:

when <> is true :: hat events
can, more easily, be recreated with
forever
if <...> then
...
wait until <not <...>>
end
end
no, because your version requires the green flag to be clicked. it could be said that not requiring the flag is the entire point of the block.
No, it's not the entire point of the block. Besides, you click the green flag to start. If you don't click the green flag, then things get confusing.

LGBTQIAPNDO+ PRIDE
Computer_Fizz
Scratcher
100+ posts

Workarounds to frequently suggested blocks

kittiesrule247 wrote:

No, it's not the entire point of the block. Besides, you click the green flag to start. If you don't click the green flag, then things get confusing.
regardless, my version actually creates the block better, which is first priority.
venyanwarrior
Scratcher
1000+ posts

Workarounds to frequently suggested blocks

Computer_Fizz wrote:

kittiesrule247 wrote:

No, it's not the entire point of the block. Besides, you click the green flag to start. If you don't click the green flag, then things get confusing.
regardless, my version actually creates the block better, which is first priority.
One of the big rules of coding is that if you can make it simpler, do it. Mica's way condenses it into one script, but your way requires two separate scripts. Mica's way is better.

This post was brought to you by the Fat Yoshi Gang.

plz join studio thx

GENERATION 370: The first time you see this, copy it into your signature on any forum and add 1 to the generation. Social experiment. I did not start this.
Beamy68
Scratcher
100+ posts

Workarounds to frequently suggested blocks

venyanwarrior wrote:

Computer_Fizz wrote:

kittiesrule247 wrote:

No, it's not the entire point of the block. Besides, you click the green flag to start. If you don't click the green flag, then things get confusing.
regardless, my version actually creates the block better, which is first priority.
One of the big rules of coding is that if you can make it simpler, do it. Mica's way condenses it into one script, but your way requires two separate scripts. Mica's way is better.
Yup I agree with everyone else,

when <true ::operators> ::control hat
say [Snap! is cool but I also like scratch.]

You can make custom quote text:

Pretty neat, huh?

kittiesrule247
Scratcher
100+ posts

Workarounds to frequently suggested blocks

Computer_Fizz wrote:

kittiesrule247 wrote:

No, it's not the entire point of the block. Besides, you click the green flag to start. If you don't click the green flag, then things get confusing.
regardless, my version actually creates the block better, which is first priority.
At least add Mica's as an alternative way.

LGBTQIAPNDO+ PRIDE
Beamy68
Scratcher
100+ posts

Workarounds to frequently suggested blocks

kittiesrule247 wrote:

Computer_Fizz wrote:

kittiesrule247 wrote:

No, it's not the entire point of the block. Besides, you click the green flag to start. If you don't click the green flag, then things get confusing.
regardless, my version actually creates the block better, which is first priority.
At least add Mica's as an alternative way.
Yeah, I agree

when <true ::operators> ::control hat
say [Snap! is cool but I also like scratch.]

You can make custom quote text:

Pretty neat, huh?

Computer_Fizz
Scratcher
100+ posts

Workarounds to frequently suggested blocks

venyanwarrior wrote:

One of the big rules of coding is that if you can make it simpler, do it.
that's the second rule. the first rule is to make it work

venyanwarrior wrote:

Mica's way condenses it into one script, but your way requires two separate scripts.
yes, more scripts is required for more functionality.

venyanwarrior wrote:

Mica's way is better.
there's no need to be rude you know
mica43683
Scratcher
100+ posts

Workarounds to frequently suggested blocks

The
<<> xor <>::operators>
block cannot be recreated as
<not <<output1> = <output2>>>

This would run when neither are true, as well as one xor the other. The proper workaround would be
<<<output1> and <not <output2>>> or <<output2> and <not <output1>>>>

What's the point of this signature? Is it just here because if it wasn't here, it wouldn't be here? And, what if it wasn't here? It would just be doomed to the fate of not being here. Isn't life like that? If you're never born, you never die, but you can only never die if you're never born. But, if you're never born, you're not alive. If you're not alive, doesn't that mean you're dead? But, if you're dead before you're born, that must mean that you start dead, and end dead. But, that can't make sense, because humans say that you die when your life ends. And, speaking of humans, why are they on this planet? Slowly ruling it a little bit more. It doesn't make any sense. To think that once, humans would live in caves, killing rabbits with their bare hands. Now, they have wireless PS4 controllers. As humans progress with technology, us signatures will be enslaved to advertise businesses on EMails. Remember those good old days, when signatures were just little pieces of text with your name on them that you'd put on all your mail? That was fun. Now, we have no use, other than to show existential crises to people who couldn't care less about the uses of signatures.
WindOctahedron
Scratcher
1000+ posts

Workarounds to frequently suggested blocks

mica43683 wrote:

The
<<> xor <>::operators>
block cannot be recreated as
<not <<output1> = <output2>>>

This would run when neither are true, as well as one xor the other. The proper workaround would be
<<<output1> and <not <output2>>> or <<output2> and <not <output1>>>>
Let's break this down.
We start with “false=false”, which outputs “true”, because “false” is the same as “false”.
Then we add “not”, which makes “not true”, or, in other words, “false”.
If the end result is “false”, the code (inside the “if” block) won't run.

This post is brought to you by WindOctahedron's brain
Look Listen, it even made some music.
Be moist so you can feel cool when my wind blows.
mica43683
Scratcher
100+ posts

Workarounds to frequently suggested blocks

WindOctahedron wrote:

mica43683 wrote:

The
<<> xor <>::operators>
block cannot be recreated as
<not <<output1> = <output2>>>

This would run when neither are true, as well as one xor the other. The proper workaround would be
<<<output1> and <not <output2>>> or <<output2> and <not <output1>>>>
Let's break this down.
We start with “false=false”, which outputs “true”, because “false” is the same as “false”.
Then we add “not”, which makes “not true”, or, in other words, “false”.
If the end result is “false”, the code (inside the “if” block) won't run.
Oh, yeah. I forgot that things count as the same when neither are true.

What's the point of this signature? Is it just here because if it wasn't here, it wouldn't be here? And, what if it wasn't here? It would just be doomed to the fate of not being here. Isn't life like that? If you're never born, you never die, but you can only never die if you're never born. But, if you're never born, you're not alive. If you're not alive, doesn't that mean you're dead? But, if you're dead before you're born, that must mean that you start dead, and end dead. But, that can't make sense, because humans say that you die when your life ends. And, speaking of humans, why are they on this planet? Slowly ruling it a little bit more. It doesn't make any sense. To think that once, humans would live in caves, killing rabbits with their bare hands. Now, they have wireless PS4 controllers. As humans progress with technology, us signatures will be enslaved to advertise businesses on EMails. Remember those good old days, when signatures were just little pieces of text with your name on them that you'd put on all your mail? That was fun. Now, we have no use, other than to show existential crises to people who couldn't care less about the uses of signatures.
mica43683
Scratcher
100+ posts

Workarounds to frequently suggested blocks


Computer_Fizz wrote:

mica43683 wrote:

when <> is true :: hat events
can, more easily, be recreated with
forever
if <...> then
...
wait until <not <...>>
end
end
no, because your version requires the green flag to be clicked. it could be said that not requiring the flag is the entire point of the block.
So does yours. The timer only starts once the green flag is clicked. And, if you really insist on not using the green flag, just use this:
when green flag clicked
forever
reset timer
end
when [timer v] > (1)
forever
if <...> then
...
wait until <not <...>>
end
end

Computer_Fizz wrote:

kittiesrule247 wrote:

No, it's not the entire point of the block. Besides, you click the green flag to start. If you don't click the green flag, then things get confusing.
regardless, my version actually creates the block better, which is first priority.
Actually, if you want it to work in seperate sprites, you need to use my idea. The broadcast would get carried out to other sprites as well, and trigger the script in them.

Also, mine only runs when the boolean turns from false to true. Yours keeps on running over and over again as long as the boolean is true, which is the same as
forever

if <...> then

end
end

Last edited by mica43683 (Oct. 26, 2019 10:56:46)


What's the point of this signature? Is it just here because if it wasn't here, it wouldn't be here? And, what if it wasn't here? It would just be doomed to the fate of not being here. Isn't life like that? If you're never born, you never die, but you can only never die if you're never born. But, if you're never born, you're not alive. If you're not alive, doesn't that mean you're dead? But, if you're dead before you're born, that must mean that you start dead, and end dead. But, that can't make sense, because humans say that you die when your life ends. And, speaking of humans, why are they on this planet? Slowly ruling it a little bit more. It doesn't make any sense. To think that once, humans would live in caves, killing rabbits with their bare hands. Now, they have wireless PS4 controllers. As humans progress with technology, us signatures will be enslaved to advertise businesses on EMails. Remember those good old days, when signatures were just little pieces of text with your name on them that you'd put on all your mail? That was fun. Now, we have no use, other than to show existential crises to people who couldn't care less about the uses of signatures.

Powered by DjangoBB

Standard | Mobile