Discuss Scratch

rollercoasterfan
Scratcher
1000+ posts

Workarounds to Commonly Suggested Blocks

DO NOT SUGGEST BLOCKS HERE! OPEN A NEW TOPIC AFTER READING THIS

Before you suggest a block, read all of this first post.

Think

1. Would this make Scratch more helpful to new scratchers?
If it doesn't, it's probably not a fit for Scratch.

2. Will this help someone learn?
If it doesn't, it also might not fit Scratch.

3. Do the new block(s) bring enough new functionality to justify the added complexity?
If it is very useful, but not very complicated, then there may be a workaround (though sometimes there may not be one)… If it is too complicated, but not very useful, it may not be a good idea because Scratch is meant for an entry-level programming level.

4. Remember, programming is never supposed to be 100% easy.

5. Are there any basic workarounds?
Read on to find basic workarounds to suggested blocks. Scratch can't have every single block, so we have to use workarounds sometimes.
____________________
([  v] recieved? ::events)


when green flag clicked
set [var v] to [0]
forever

if <(var) = [1]> then

set [var v] to [0]
...
end

end


when I receive [message v]
set [var v] to [1]
wait (0.25) secs
set [var v] to [0]
____________________
when <> ::events hat
...


when [timer v] > (0.1)
forever

if <> then
...
end

end
____________________
when costume switches to [costume1 v] ::events hat

when gf clicked
forever
wait until <([costume name v] of [sprite v]) = [costume name here]>
...
end
____________________
(clone? ::sensing)

when I start as a clone
set [clone? v] to [true] //variable for this sprite only
____________________
(ask in progress? ::sensing)

set [ask v] to [1]
ask [...] and wait
set [ask v] to [0]
____________________
(sprite clicked? ::sensing)


when this sprite clicked
set [clicked v] to [1]
wait until <not <<mouse down?> and <touching [mouse-pointer v] ?> >>
set [clicked v] to [0]
____________________
(true ::operators)

<[0] = [0]>
____________________
(false ::operators)

<[0] = [1]>
____________________
([] ≠ [] ::operators)
<not <[] = [ ]>>
____________________
([] ≥  [] ::operators)
<not <[] < [ ]>>
____________________
([] ≤  [] ::operators)
<not <[] > [ ]>>
____________________
(round () to the nearest () ::operators)
((round ((round what) / (to the nearest))) * (to the nearest))
____________________
(negate (number)::operators)
((0) - (number))
____________________
if <> then ::cstart

else if <> ::celse
end

if <> then

else
if <> then

end

end
____________________
forever if <> ::control cstart
end

forever

if <> then

end

end
____________________
repeat () secs ::control cstart
end

reset timer //this will only work if you're not using the timer elsewhere in your project
repeat until <(timer) = (number)>
...
end

set [old timer v] to (timer)
repeat until (((timer) - (old timer)) > (seconds ::grey) ) //use this if you are using the timer elsewhere in your project
...
end
____________________
previous costume ::looks

switch costume to ((costume #) - (1))
____________________
(costume name ::looks)
([costume name v] of [sprite v])
____________________

Please tell me if you have any other commonly suggested blocks with workarounds, and if any of the workarounds here are wrong.

Scratch Team, feel free to edit this and add or change any of these.

Link to wiki for some of these is here, but other ones came from other members of the community.

Last edited by rollercoasterfan (Aug. 24, 2015 00:35:09)

rollercoasterfan
Scratcher
1000+ posts

Workarounds to Commonly Suggested Blocks

~Reserved for future needs~
rollercoasterfan
Scratcher
1000+ posts

Workarounds to Commonly Suggested Blocks

~Reserved for future needs~
TheUniversalWorld1
Scratcher
100+ posts

Workarounds to Commonly Suggested Blocks

<<touching [mouse-pointer v] ?> and <mouse down?>> // Should have a note saying not exact workaround for "clicking".

Last edited by TheUniversalWorld1 (June 23, 2015 17:40:22)

DaSpudLord
Scratcher
1000+ posts

Workarounds to Commonly Suggested Blocks

This needs to be stickied.
seanbobe
Scratcher
500+ posts

Workarounds to Commonly Suggested Blocks

DaSpudLord wrote:

This needs to be stickied.
Pot-of-Gold
Scratcher
1000+ posts

Workarounds to Commonly Suggested Blocks

seanbobe wrote:

DaSpudLord wrote:

This needs to be stickied.
This does
and may you add the negate block:
negate (number) :: operators reporter
((0) - (number))
Pot-of-Gold
Scratcher
1000+ posts

Workarounds to Commonly Suggested Blocks

The brodcast message one is wrong its:
when green flag clicked
set [var v] to [0]

when I receive [message v]
set [var v] to [1]
wait (0.25) secs
set [var v] to [0]
The actual block after all that is:
<(var) = [1]> // this is the boolean you use

Last edited by Pot-of-Gold (June 23, 2015 19:15:08)

Pot-of-Gold
Scratcher
1000+ posts

Workarounds to Commonly Suggested Blocks

Lastly add:
forever if < > :: control cstart
end

forever

if <> then

end

end
And:
previous costume :: looks

switch costume to ((costume #) - (1))
seanbobe
Scratcher
500+ posts

Workarounds to Commonly Suggested Blocks

Pot-of-Gold wrote:

The brodcast message one is wrong its:
when green flag clicked
set [var v] to [0]

when I receive [message v]
set [var v] to [1]
Then use:
when green flag clicked
forever

if <(var) = [1]> then
set [var v] to [0]
...
end

end
The actual block after all that is:
<(var) = [1]> // this is the boolean you use

no it is

when green flag clicked
set [var v] to [0]


when I receive [... v]
set [var v] to [1]
wait (0.25) secs
set [var v] to [0]

<(var) = [1]>
thelucariokid
Scratcher
100+ posts

Workarounds to Commonly Suggested Blocks

There's a Wiki page for those. You should add those.
rollercoasterfan
Scratcher
1000+ posts

Workarounds to Commonly Suggested Blocks

thelucariokid wrote:

There's a Wiki page for those. You should add those.
I actually copied these off of the wiki, but I didn't do them all, since some aren't commonly suggested.
Pot-of-Gold
Scratcher
1000+ posts

Workarounds to Commonly Suggested Blocks

I reported it to be stickied
rollercoasterfan
Scratcher
1000+ posts

Workarounds to Commonly Suggested Blocks

Pot-of-Gold wrote:

I reported it to be stickied
I did probably 20 minutes ago. Thanks though!
Pot-of-Gold
Scratcher
1000+ posts

Workarounds to Commonly Suggested Blocks

rollercoasterfan wrote:

Pot-of-Gold wrote:

I reported it to be stickied
I did probably 20 minutes ago. Thanks though!
I did it like an hour ago thougoh. Well, the more, the better.
Congrats on the sticky btw!
Also, you do not need the forever if var=1 part in the brodcast one
rollercoasterfan
Scratcher
1000+ posts

Workarounds to Commonly Suggested Blocks

Pot-of-Gold wrote:

Congrats on the sticky btw!
Thanks!

Pot-of-Gold wrote:

Also, you do not need the forever if var=1 part in the brodcast one
Yeah, but otherwise some scratchers might think they can just use the var = 1, but you can't use it on your own.
Pot-of-Gold
Scratcher
1000+ posts

Workarounds to Commonly Suggested Blocks

rollercoasterfan wrote:

Pot-of-Gold wrote:

Congrats on the sticky btw!
Thanks!

Pot-of-Gold wrote:

Also, you do not need the forever if var=1 part in the brodcast one
Yeah, but otherwise some scratchers might think they can just use the var = 1, but you can't use it on your own.
oh, but if its a boolean, the workaround should be a boolean
rollercoasterfan
Scratcher
1000+ posts

Workarounds to Commonly Suggested Blocks

Pot-of-Gold wrote:

rollercoasterfan wrote:

Pot-of-Gold wrote:

Congrats on the sticky btw!
Thanks!

Pot-of-Gold wrote:

Also, you do not need the forever if var=1 part in the brodcast one
Yeah, but otherwise some scratchers might think they can just use the var = 1, but you can't use it on your own.
oh, but if its a boolean, the workaround should be a boolean
It's fine.
ollie_manning
Scratcher
44 posts

Workarounds to Commonly Suggested Blocks

I think scratch should add

(I receive [message])

if <(I receive [message])> then
move (10) steps
end

Last edited by ollie_manning (June 24, 2015 18:45:59)

Pot-of-Gold
Scratcher
1000+ posts

Workarounds to Commonly Suggested Blocks

rollercoasterfan wrote:

Pot-of-Gold wrote:

rollercoasterfan wrote:

Pot-of-Gold wrote:

Congrats on the sticky btw!
Thanks!

Pot-of-Gold wrote:

Also, you do not need the forever if var=1 part in the brodcast one
Yeah, but otherwise some scratchers might think they can just use the var = 1, but you can't use it on your own.
oh, but if its a boolean, the workaround should be a boolean
It's fine.
yeah

ollie_manning wrote:

I think scratch should add

I receive [message]
This is not a suggestions topic. Its a list to WORKAROUNDS to suggested blocks

Powered by DjangoBB