Discuss Scratch

NxNmultiply
Scratcher
100+ posts

Workarounds to frequently suggested blocks

for{a::grey}<b::grey>{c::grey}then{
...
}::control

a::grey
while<b::grey>then{
...
c::grey
}::control

Example:
[double v] [b] = (1)::variables
for{[double v] [a] = (0)::variables}\ <(a)\<(16)>\ {[a]++::variables}then{
[b] *= (3) ::variables
}::control

set [b v] to [1]
set [a v] to [0]
while<(a)\<[16]>then{
set [b v] to ((b)*(3))
change [a v] by (1)
}::control
-LekkerGames-
Scratcher
67 posts

Workarounds to frequently suggested blocks

Computer_Fizz wrote:

Events :: events hat
when ( :: obsolete) clicked :: events hat
...
can be recreated with the following code:
when @greenFlag clicked
forever
set [timer v] to ( timer )
end

when [timer v] > ( timer :: variables )
. . .
It can also be recreated like this:
when green flag clicked
forever
reset timer
end
when [timer v] > (0)
...

when i wake up::hat , events
if <(year) = (2020)> then
go back to bed::motion
else
think [I am happy it is not 2020] for (2) secs
go back to bed::motion
end
Super_Scratch_Bros20
Scratcher
1000+ posts

Workarounds to frequently suggested blocks

-LekkerGames- wrote:

Computer_Fizz wrote:

Events :: events hat
when ( :: obsolete) clicked :: events hat
...
can be recreated with the following code:
when @greenFlag clicked
forever
set [timer v] to ( timer )
end

when [timer v] > ( timer :: variables )
. . .
It can also be recreated like this:
when green flag clicked
forever
reset timer
end
when [timer v] > (0)
...

No, actually. The timer resets once the green flag starts. So, it would have to be a larger value than zero once the green flag is pressed. In other words, once the green flag would be pressed, that script would run, not when the stop sign is clicked.


Hopeijay
Scratcher
90 posts

Workarounds to frequently suggested blocks

NxNmultiply wrote:

for{a::grey}<b::grey>{c::grey}then{
...
}::control

a::grey
while<b::grey>then{
...
c::grey
}::control

Example:
[double v] [b] = (1)::variables
for{[double v] [a] = (0)::variables}\ <(a)\<(16)>\ {[a]++::variables}then{
[b] *= (3) ::variables
}::control

set [b v] to [1]
set [a v] to [0]
while<(a)\<[16]>then{
set [b v] to ((b)*(3))
change [a v] by (1)
}::control

You can probably do the ‘while’ block with:
set [b v] to [1]
set [a v] to [0]
repeat until <not<(a)\<[16]>>then{
set [b v] to ((b)*(3))
change [a v] by (1)
}::control

Hope this helps!


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!
8bitjake
Scratcher
100+ posts

Workarounds to frequently suggested blocks

Computer_Fizz wrote:

List :: list hat
 ( item ( last v ) of [ list v] ) 
can be recreated with the following code:
 ( item ( length of [ list v] ) of [ list v] ) 

I want to suggest something new. Link will be posted here when the thread goes live.


Hopeijay
Scratcher
90 posts

Workarounds to frequently suggested blocks

Super_Scratch_Bros20 wrote:

-LekkerGames- wrote:

Computer_Fizz wrote:

Events :: events hat
when ( :: obsolete) clicked :: events hat
...
can be recreated with the following code:
when @greenFlag clicked
forever
set [timer v] to ( timer )
end

when [timer v] > ( timer :: variables )
. . .
It can also be recreated like this:
when green flag clicked
forever
reset timer
end
when [timer v] > (0)
...

No, actually. The timer resets once the green flag starts. So, it would have to be a larger value than zero once the green flag is pressed. In other words, once the green flag would be pressed, that script would run, not when the stop sign is clicked.

Actually no, I tested it out and it works just fine! -LekkerGames- is correct, that does also work.


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!
Boomer001
Scratcher
1000+ posts

Workarounds to frequently suggested blocks

Computer_Fizz wrote:

bounce :: motion
can be recreated with the following code:
point in direction ( ( direction ) - ( 180 ) )
There is a lot easier way to do that:
turn cw (180) degrees

:::::::::   ::::::::   ::::::::  ::::    ::::  :::::::::: :::::::::   :::::::   :::::::    :::   
:+:    :+: :+:    :+: :+:    :+: +:+:+: :+:+:+ :+:        :+:    :+: :+:   :+: :+:   :+: :+:+:   
+:+    +:+ +:+    +:+ +:+    +:+ +:+ +:+:+ +:+ +:+        +:+    +:+ +:+  :+:+ +:+  :+:+   +:+   
+#++:++#+  +#+    +:+ +#+    +:+ +#+  +:+  +#+ +#++:++#   +#++:++#:  +#+ + +:+ +#+ + +:+   +#+   
+#+    +#+ +#+    +#+ +#+    +#+ +#+       +#+ +#+        +#+    +#+ +#+#  +#+ +#+#  +#+   +#+   
#+#    #+# #+#    #+# #+#    #+# #+#       #+# #+#        #+#    #+# #+#   #+# #+#   #+#   #+#   
#########   ########   ########  ###       ### ########## ###    ###  #######   #######  ####### 
CHECK OUT MY FORUM STATS



















Hopeijay
Scratcher
90 posts

Workarounds to frequently suggested blocks

Boomer001 wrote:

Computer_Fizz wrote:

bounce :: motion
can be recreated with the following code:
point in direction ( ( direction ) - ( 180 ) )
There is a lot easier way to do that:
turn cw (180) degrees

Or, for a more realistic bounce:
point in direction ([0] - (direction))
turn cw [180] degrees


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!
FireEmeraldAnimator
Scratcher
31 posts

Workarounds to frequently suggested blocks

Is there a way to work around a repeat for ( ) seconds loop?

Last edited by FireEmeraldAnimator (May 14, 2020 00:42:43)

BestUsernameSoFar
Scratcher
100+ posts

Workarounds to frequently suggested blocks

FireEmeraldAnimator wrote:

Is there a way to work around a repeat for ( ) seconds loop?
Yes, do this.
Create a variable
(seconds)
Make this variable set to zero and then always change every one second.
set [seconds v] to (0)
forever
wait (1) secs
change [seconds v] by (1)
end
After that, do this:
repeat until <(seconds)= (5)>
set [seconds v] to (0)
. . .
end

Who am I?
Hi I'm BestUsernameSoFar, but you can call me Besty.

(•~•::#30D5C8) // this is Busf, my pet scratchblock!

Please press Ctrl + Shift + Down to see the rest of my signature
or if you're on mobile simply highlight it and scroll down.

Paul wrote:

For I am convinced that neither death nor life, neither angels nor demons, neither the present nor the future, nor any powers, neither height nor depth, nor anything else in all creation, will be able to separate us from the love of God that is in Christ Jesus our Lord.

I am an Scratcher that makes Games and Animations!
√ Minecraft
X Roblox
X Fortnite
√ Animal Crossing
√ Mario Galaxy
X Stardew Valley
√ Star Wars: Battlefront
FireEmeraldAnimator
Scratcher
31 posts

Workarounds to frequently suggested blocks

BestUsernameSoFar wrote:

FireEmeraldAnimator wrote:

Is there a way to work around a repeat for ( ) seconds loop?
Yes, do this.
Create a variable
(seconds)
Make this variable set to zero and then always change every one second.
set [seconds v] to (0)
forever
wait (1) secs
change [seconds v] by (1)
end
After that, do this:
repeat until <(seconds)= (5)>
set [seconds v] to (0)
. . .
end
Okay, thanks!
Monniasza_spzoo
Scratcher
100+ posts

Workarounds to frequently suggested blocks

Computer_Fizz wrote:

List :: list hat
 ( item ( last v ) of [ list v] ) 
can be recreated with the following code:
 ( item ( length of [ list v] ) of [ list v] ) 

It's not only way.
(item (join [la] [st]) of [list v] :: list)
The_King_In_Yellow
Scratcher
15 posts

Workarounds to frequently suggested blocks

Computer_Fizz wrote:

Operators :: operators hat
< < . . . > xor < . . . > :: operators>
can be recreated with the following code:
< not < < . . . > = < . . . > > >
———————————————————–
 < true :: operators> 
can be recreated with the following code:
 < [1] = [1] > 
———————————————————–
 < false :: operators> 
can be recreated with the following code:
 < [1] > [2] > 
———————————————————–
 ( letters ( start ) through ( end :: variables) of ( string ) :: operators) 
can be recreated with the following code:
set [iterator v] to ( start )
set [result v] to []
repeat ( ( ( end :: variables) - ( start ) ) + ( 1 ) )
set [result v] to ( join ( result ) ( letter ( iterator ) of ( string ) ) )
end
———————————————————–
< ( . . . ) ≥ ( . . . ) :: operators >
can be recreated with the following code:
< not < ( . . . ) < ( . . . ) > >
———————————————————–
< ( . . . ) ≤ ( . . . ) :: operators >
can be recreated with the following code:
< not < ( . . . ) > ( . . . ) > >
for those 1984 fans out there,
<true:: operators>
can be recreated as
<([2]+[2])=[5]>

when <forum post is [loaded v]?::sensing> is true::control hat
repeat until <([2]+[2])=[5]>
broadcast [welp this is my signature hope u like it v]
end
comment [lol no evil kumquat would dare eat my signature i have Kirby on my side >:D]:: grey stack
I don't really use Scratch anymore, by the way.
Beamy68
Scratcher
100+ posts

Workarounds to frequently suggested blocks

Multiple people wrote:
-snip-

The_King_In_Yellow wrote:

for those 1984 fans out there,
<true:: operators>
can be recreated as
<([2]+[2])=[5]>
Please only use constructive criticism and real workarounds.
Example:
<true::operators>
can be recreated as
<((2) + (two)) = [5]>
set [two v] to [3]

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
JustTbear
Scratcher
100+ posts

Workarounds to frequently suggested blocks

ComputerFizz wrote:

bounce :: motion
can be recreated with the following code:
point in direction ( ( direction ) - ( 180 ) )
… or easily with
turn ccw (180) degrees

Last edited by JustTbear (May 23, 2020 08:17:38)

DaveTheBaby
Scratcher
15 posts

Workarounds to frequently suggested blocks

orrinpants wrote:

i wish there was a AM/PM block


if <(current [AM/PM v]) = [PM]> then
say [its late] for (2) secs
end
I might do that in my mod

DAVETHEBABY
def DaveTheBaby {
{
skits::motion
games::sensing
other stuff including ({OS's::#008080}{Filler stuff::#009a00}{Tutorials::sound}@delInput@addInput::ring grey)::control
}::ring grey
}::hat custom
end def::cap custom
Ace12Best
Scratcher
100+ posts

Workarounds to frequently suggested blocks

If you made a variable “Speed” (let's say speed is 12)
You would do
if <key [right] pressed?> then
change x by (speed)
end
But how do you do change x by -Speed
Do this
change x by ((0) - (speed)
I did that on my test account
Thanks for all the help I see on this topic it is amazing

ᴘʟᴇᴀꜱᴇ ᴄʜᴇᴄᴋ ᴏᴜᴛ ꜱᴏᴍᴇ ᴏꜰ ᴍʏ ɢᴀᴍᴇꜱ :ᴅ
Lava Skipper
Dodge It
AND IF YOU'RE A FAN OF MUSIC! Check out my Scratch Music Player
Please follow me I'm Ace12Best I love helping out and I make fun projects for everyone to enjoy
Please check out my website!
howlepey000
Scratcher
32 posts

Workarounds to frequently suggested blocks

here is a idea!
when "stop sign picture" clicked

make sure to try this out!: turbo warp
howlepey000
Scratcher
32 posts

Workarounds to frequently suggested blocks

can you add this block?
(event)
when stop sign clicked

make sure to try this out!: turbo warp
BestUsernameSoFar
Scratcher
100+ posts

Workarounds to frequently suggested blocks

howlepey000 wrote:

can you add this block?
(event)
when stop sign clicked
Please create your own post. Don't nectropost.

Who am I?
Hi I'm BestUsernameSoFar, but you can call me Besty.

(•~•::#30D5C8) // this is Busf, my pet scratchblock!

Please press Ctrl + Shift + Down to see the rest of my signature
or if you're on mobile simply highlight it and scroll down.

Paul wrote:

For I am convinced that neither death nor life, neither angels nor demons, neither the present nor the future, nor any powers, neither height nor depth, nor anything else in all creation, will be able to separate us from the love of God that is in Christ Jesus our Lord.

I am an Scratcher that makes Games and Animations!
√ Minecraft
X Roblox
X Fortnite
√ Animal Crossing
√ Mario Galaxy
X Stardew Valley
√ Star Wars: Battlefront

Powered by DjangoBB