Discuss Scratch
- Discussion Forums
- » Suggestions
- » Workarounds to frequently suggested blocks
- NxNmultiply
-
Scratcher
100+ posts
Workarounds to frequently suggested blocks
for{a::grey}<b::grey>{c::grey}then{
...
}::controla::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
It can also be recreated like this:Events :: events hatwhen ( :: obsolete) clicked :: events hatcan be recreated with the following code:
...when @greenFlag clicked
forever
set [timer v] to ( timer )
end
when [timer v] > ( timer :: variables )
. . .
when green flag clicked
forever
reset timer
end
when [timer v] > (0)
...
- Super_Scratch_Bros20
-
Scratcher
1000+ posts
Workarounds to frequently suggested blocks
It can also be recreated like this:Events :: events hatwhen ( :: obsolete) clicked :: events hatcan be recreated with the following code:
...when @greenFlag clicked
forever
set [timer v] to ( timer )
end
when [timer v] > ( timer :: variables )
. . .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
for{a::grey}<b::grey>{c::grey}then{
...
}::controla::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
}::controlset [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!
- Hopeijay
-
Scratcher
90 posts
Workarounds to frequently suggested blocks
It can also be recreated like this:Events :: events hatwhen ( :: obsolete) clicked :: events hatcan be recreated with the following code:
...when @greenFlag clicked
forever
set [timer v] to ( timer )
end
when [timer v] > ( timer :: variables )
. . .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.
- Boomer001
-
Scratcher
1000+ posts
Workarounds to frequently suggested blocks
There is a lot easier way to do that:bounce :: motioncan be recreated with the following code:point in direction ( ( direction ) - ( 180 ) )
turn cw (180) degrees
- Hopeijay
-
Scratcher
90 posts
Workarounds to frequently suggested blocks
There is a lot easier way to do that:bounce :: motioncan be recreated with the following code:point in direction ( ( direction ) - ( 180 ) )turn cw (180) degrees
Or, for a more realistic bounce:
point in direction ([0] - (direction))
turn cw [180] degrees
- 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
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)After that, do this:
forever
wait (1) secs
change [seconds v] by (1)
end
repeat until <(seconds)= (5)>
set [seconds v] to (0)
. . .
end
- FireEmeraldAnimator
-
Scratcher
31 posts
Workarounds to frequently suggested blocks
Okay, thanks!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)After that, do this:
forever
wait (1) secs
change [seconds v] by (1)
endrepeat until <(seconds)= (5)>
set [seconds v] to (0)
. . .
end
- Monniasza_spzoo
-
Scratcher
100+ posts
Workarounds to frequently suggested blocks
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
for those 1984 fans out there,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 < ( . . . ) > ( . . . ) > >
<true:: operators>can be recreated as
<([2]+[2])=[5]>
- Beamy68
-
Scratcher
100+ posts
Workarounds to frequently suggested blocks
Multiple people wrote:
-snip-
for those 1984 fans out there,Please only use constructive criticism and real workarounds.<true:: operators>can be recreated as<([2]+[2])=[5]>
Example:
<true::operators>can be recreated as
<((2) + (two)) = [5]>
set [two v] to [3]
- JustTbear
-
Scratcher
100+ posts
Workarounds to frequently suggested blocks
… or easily withbounce :: motioncan be recreated with the following code:point in direction ( ( direction ) - ( 180 ) )
turn ccw (180) degrees
Last edited by JustTbear (May 23, 2020 08:17:38)
- DaveTheBaby
-
Scratcher
17 posts
Workarounds to frequently suggested blocks
i wish there was a AM/PM blockI might do that in my modif <(current [AM/PM v]) = [PM]> then
say [its late] for (2) secs
end
- Ace12Best
-
Scratcher
100+ posts
Workarounds to frequently suggested blocks
If you made a variable “Speed” (let's say speed is 12)
You would do
Do this

Thanks for all the help I see on this topic it is amazing
You would do
if <key [right] pressed?> thenBut how do you do change x by -Speed
change x by (speed)
end
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

- howlepey000
-
Scratcher
32 posts
Workarounds to frequently suggested blocks
here is a idea!
when "stop sign picture" clicked
- howlepey000
-
Scratcher
32 posts
Workarounds to frequently suggested blocks
can you add this block?
(event)
(event)
when stop sign clicked
- BestUsernameSoFar
-
Scratcher
100+ posts
Workarounds to frequently suggested blocks
can you add this block?Please create your own post. Don't nectropost.
(event)when stop sign clicked
- Discussion Forums
- » Suggestions
-
» Workarounds to frequently suggested blocks













