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.
venyanwarrior
Scratcher
1000+ posts

Workarounds to frequently suggested blocks

Here is a workaround to a block:

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



If you're seeing this signature, that means I've come out of my social anxiety hole.

Also, I edit the Scratch Wiki. Check it out sometime it's cool I guess.
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 <[] < []>>

The message above may contain wrong information, rude remarks, or something embarrassing to my current self. In this case, please ignore it and remember that I likely wrote it back when I didn't know what “respect” truly meant. I really hate thinking about it again.
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
90 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)


Post Goal:


Motion::motion
Looks::looks
Sound::sound
Pen::pen
Events::events
Control::control
Sensing::sensing
Operators::operators
Variables::variables
List::list
More Blocks::custom
bemy
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.

The message above may contain wrong information, rude remarks, or something embarrassing to my current self. In this case, please ignore it and remember that I likely wrote it back when I didn't know what “respect” truly meant. I really hate thinking about it again.
mica43683
Scratcher
500+ 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

I got a lot of compliments on my last signature, and I think that's kind of strange. I wrote it when I was 12 and it wasn't very good. I acted like PS4 controllers were the epitome of human technology, for God's sake! I tried too hard to be philosophical, or maybe I tried too hard to be funny, or maybe it was something else. But that signature was bad. It wasn't good. It might be strange for some of you to hear this, seeing as this site is full of kids, but 12-year-old me was practically a baby. I think that's something you realise when you grow up. That you're always better than you were last year. I was looking through old Skype messages between me and a friend of mine from when we were 12, and as I read them, I couldn't stop thinking, “Woah. I was the worst.” It's important to know that you're always the worst. I can almost guarantee that future you is thinking negatively of you right now, just as future me is thinking negatively of me. It's important not to let that get to you. Remember to stay in the present. Tomorrow hates you, but it can't hurt you because you'll never get to tomorrow. When I was 10 or 11, I remember seeing the world very cynically. I thought that human life was inherently selfish, and that we were only put on this planet to destroy it. I'm so glad 10 or 11 year old me is gone, because 17 year old me would NOT get along with that kid.
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.

If you're seeing this signature, that means I've come out of my social anxiety hole.

Also, I edit the Scratch Wiki. Check it out sometime it's cool I guess.
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,

Post Goal:


Motion::motion
Looks::looks
Sound::sound
Pen::pen
Events::events
Control::control
Sensing::sensing
Operators::operators
Variables::variables
List::list
More Blocks::custom
bemy
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

Post Goal:


Motion::motion
Looks::looks
Sound::sound
Pen::pen
Events::events
Control::control
Sensing::sensing
Operators::operators
Variables::variables
List::list
More Blocks::custom
bemy
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
500+ 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>>>>

I got a lot of compliments on my last signature, and I think that's kind of strange. I wrote it when I was 12 and it wasn't very good. I acted like PS4 controllers were the epitome of human technology, for God's sake! I tried too hard to be philosophical, or maybe I tried too hard to be funny, or maybe it was something else. But that signature was bad. It wasn't good. It might be strange for some of you to hear this, seeing as this site is full of kids, but 12-year-old me was practically a baby. I think that's something you realise when you grow up. That you're always better than you were last year. I was looking through old Skype messages between me and a friend of mine from when we were 12, and as I read them, I couldn't stop thinking, “Woah. I was the worst.” It's important to know that you're always the worst. I can almost guarantee that future you is thinking negatively of you right now, just as future me is thinking negatively of me. It's important not to let that get to you. Remember to stay in the present. Tomorrow hates you, but it can't hurt you because you'll never get to tomorrow. When I was 10 or 11, I remember seeing the world very cynically. I thought that human life was inherently selfish, and that we were only put on this planet to destroy it. I'm so glad 10 or 11 year old me is gone, because 17 year old me would NOT get along with that kid.
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.

The message above may contain wrong information, rude remarks, or something embarrassing to my current self. In this case, please ignore it and remember that I likely wrote it back when I didn't know what “respect” truly meant. I really hate thinking about it again.
mica43683
Scratcher
500+ 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.

I got a lot of compliments on my last signature, and I think that's kind of strange. I wrote it when I was 12 and it wasn't very good. I acted like PS4 controllers were the epitome of human technology, for God's sake! I tried too hard to be philosophical, or maybe I tried too hard to be funny, or maybe it was something else. But that signature was bad. It wasn't good. It might be strange for some of you to hear this, seeing as this site is full of kids, but 12-year-old me was practically a baby. I think that's something you realise when you grow up. That you're always better than you were last year. I was looking through old Skype messages between me and a friend of mine from when we were 12, and as I read them, I couldn't stop thinking, “Woah. I was the worst.” It's important to know that you're always the worst. I can almost guarantee that future you is thinking negatively of you right now, just as future me is thinking negatively of me. It's important not to let that get to you. Remember to stay in the present. Tomorrow hates you, but it can't hurt you because you'll never get to tomorrow. When I was 10 or 11, I remember seeing the world very cynically. I thought that human life was inherently selfish, and that we were only put on this planet to destroy it. I'm so glad 10 or 11 year old me is gone, because 17 year old me would NOT get along with that kid.
mica43683
Scratcher
500+ 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)


I got a lot of compliments on my last signature, and I think that's kind of strange. I wrote it when I was 12 and it wasn't very good. I acted like PS4 controllers were the epitome of human technology, for God's sake! I tried too hard to be philosophical, or maybe I tried too hard to be funny, or maybe it was something else. But that signature was bad. It wasn't good. It might be strange for some of you to hear this, seeing as this site is full of kids, but 12-year-old me was practically a baby. I think that's something you realise when you grow up. That you're always better than you were last year. I was looking through old Skype messages between me and a friend of mine from when we were 12, and as I read them, I couldn't stop thinking, “Woah. I was the worst.” It's important to know that you're always the worst. I can almost guarantee that future you is thinking negatively of you right now, just as future me is thinking negatively of me. It's important not to let that get to you. Remember to stay in the present. Tomorrow hates you, but it can't hurt you because you'll never get to tomorrow. When I was 10 or 11, I remember seeing the world very cynically. I thought that human life was inherently selfish, and that we were only put on this planet to destroy it. I'm so glad 10 or 11 year old me is gone, because 17 year old me would NOT get along with that kid.

Powered by DjangoBB