Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Fewest amount of blocks technically needed to use Scratch
- scratchisthebest
- Scratcher
1000+ posts
Fewest amount of blocks technically needed to use Scratch
Apologies if this doesn't make sense in this forum. Just think this will interest a couple of you guys
Okay, so if you hang around the Suggestions forum a lot, you'll sometimes see insane suggestions such as “Remove the ‘glide’ block!”, “Remove the forever block!”, and “Remove the ‘next costume’ block!” They're often posted somewhat ironically, in reference to refusing to add a “previous costume” block because it's workaroundable.
Which got me thinking - what happens if we ride this slippery slope to its very bottom? If Scratch implemented every single suggestion to remove a block, how many blocks could be removed before Scratch becomes unusable, not Turing-complete, or impossible to recreate certain projects with it?
What is the smallest amount of blocks that Scratch really “needs”?
Okay, so if you hang around the Suggestions forum a lot, you'll sometimes see insane suggestions such as “Remove the ‘glide’ block!”, “Remove the forever block!”, and “Remove the ‘next costume’ block!” They're often posted somewhat ironically, in reference to refusing to add a “previous costume” block because it's workaroundable.
Which got me thinking - what happens if we ride this slippery slope to its very bottom? If Scratch implemented every single suggestion to remove a block, how many blocks could be removed before Scratch becomes unusable, not Turing-complete, or impossible to recreate certain projects with it?
What is the smallest amount of blocks that Scratch really “needs”?
I am a Lava Expert
- Dylan5797
- Scratcher
1000+ posts
Fewest amount of blocks technically needed to use Scratch
Hmm…
I'll post my updates here later
I'll post my updates here later
- herohamp
- Scratcher
1000+ posts
Fewest amount of blocks technically needed to use Scratch
Ok. Remove the x steps forward and us the wordaround
I made a studio for this https://scratch-mit-edu.ezproxy.canberra.edu.au/studios/1900111/
I made a studio for this https://scratch-mit-edu.ezproxy.canberra.edu.au/studios/1900111/
- -Io-
- Scratcher
1000+ posts
Fewest amount of blocks technically needed to use Scratch
Use a big tape. Assign different actions to every pointer. Use a command to execute the action assigned to that pointer.
( ͡° ͜ʖ ͡°)
So… basically branflakes. You could even implement one of the shorter more annoying versions
( ͡° ͜ʖ ͡°)
when gf clicked
move right :: motion
move left :: motion
while tape != 0 :: cstart control
increase :: operators
decrease :: operators
:: cend
execute :: control
So… basically branflakes. You could even implement one of the shorter more annoying versions
Last edited by -Io- (April 26, 2016 15:39:55)
- Tymewalk
- Scratcher
1000+ posts
Fewest amount of blocks technically needed to use Scratch
Here's my list:
Probably a bunch more, too. Interesting…
forever - repeat (99999999999999999...)
go to x:() y:() - set x to (), set y to ()
move () steps - lot of code I can't post here but definitely possible
change [v] by () - set [v] to (thing) + ()
() * () - use () + () repeatedly
if then else:
set [else v] to [0]
if <thing> then
set [else v] to [1]
end
if <(else :: variables) = [0]> then
...
end
Probably a bunch more, too. Interesting…
bold thing - italic thing - underlined thing - strikethrough thing
- NickyNouse
- Scratcher
1000+ posts
Fewest amount of blocks technically needed to use Scratch
Forever and repeat () would both be out, the only thing you technically need is repeat until
the subtract block is gone, you can do ((x)+((-1) * (x)))
likewise, a good portion of the functions in the ([ v] of ()) operator block can be achieved with if-else and a lot of basic arithmetic blocks
custom blocks are probably out, everything you can do with a custom block can be achieved with a broadcast one way or another
the subtract block is gone, you can do ((x)+((-1) * (x)))
likewise, a good portion of the functions in the ([ v] of ()) operator block can be achieved with if-else and a lot of basic arithmetic blocks
custom blocks are probably out, everything you can do with a custom block can be achieved with a broadcast one way or another
- DigiTechs
- Scratcher
500+ posts
Fewest amount of blocks technically needed to use Scratch
Forever and repeat () would both be out, the only thing you technically need is repeat until
the subtract block is gone, you can do ((x)+((-1) * (x)))
likewise, a good portion of the functions in the ([ v] of ()) operator block can be achieved with if-else and a lot of basic arithmetic blocks
custom blocks are probably out, everything you can do with a custom block can be achieved with a broadcast one way or another
Due to how Scratch is structured, you don't even need ‘repeat until’; broadcast ‘tail calling’ would work fine.
Also, you don't need a multiply to make it negative; just use the (join ) block to append a minus.
You don't even need multiply, really; just use repeated adding. Division might be a mandatory though (unless you want to work in 1 remainder 2 land) and modulus can just be repeated subtraction until x is less than your divisor (i.e. 1 remainder 2 land).
I do, in fact, have my own site; it's here.
I'm also working on a thing called Fetch. Look at it here!
@thisandagain pls explain. @thisandagain pls explain. @thisandagain pls explain. @thisandagain pls explain. @thisandagain pls explain.
- NickyNouse
- Scratcher
1000+ posts
Fewest amount of blocks technically needed to use Scratch
good catch, even better xD Due to how Scratch is structured, you don't even need ‘repeat until’; broadcast ‘tail calling’ would work fine.
I left multiply in there because decimal multiplication can't be replicated with addition, but there's probably a way to do it with just addition and division if you're smart about it You don't even need multiply, really; just use repeated adding. Division might be a mandatory though (unless you want to work in 1 remainder 2 land) and modulus can just be repeated subtraction until x is less than your divisor (i.e. 1 remainder 2 land).
Oh, and remove the “if” block. You can get the same functionality with if-else and leaving the “else” area blank
Last edited by NickyNouse (April 26, 2016 16:43:06)
- MegaApuTurkUltra
- Scratcher
1000+ posts
Fewest amount of blocks technically needed to use Scratch
Full list of what's required and what needs workarounds
If you see anything required that you have a reasonable workaround for (eg, using e^ and log for multiplication and division is not acceptable because of accuracy issues) let me know
() - () // use join[-](number)
() * () // REQUIRED
() / () // https://scratch-mit-edu.ezproxy.canberra.edu.au/discuss/post/1955358/
() and () // https://scratch-mit-edu.ezproxy.canberra.edu.au/discuss/post/1955054/
() Mod () // use / and floor
() + () // REQUIRED
() < () // REQUIRED
() = () // REQUIRED
() > () // use not < and not =
() or () // use not<not<> and not<>>
Answer // REQUIRED
Backdrop # // REQUIRED
If on Edge, Bounce // use touching edge and rotate 180
Broadcast () // REQUIRED
Change () Effect by () // keep track of effect value with variable
Change Pen Color by () // keep track of color with variable and do hsl calculation
Change Pen Shade by () // same
Change Pen Size by () // keep track of pen size
Change Size by () // keep track of size
Change Tempo by () // keep track of tempo
Change () by () // use set [thing] to ((thing)+(...))
Change Volume by () // keep track of volume
Change X by () // keep track of position
Change Y by () // same
Clear // REQUIRED
Color () is Touching ()? // REQUIRED
Delete ( v) of [ v] // REQUIRED
Go to Front // use move back (-9999)
[ v] of ()::operators // REQUIRED
Join ()() // REQUIRED
list reporter::list // REQUIRED
Costume # // REQUIRED
Create Clone of () // use stamp / lists
Delete This Clone // same
Distance to () // calculate yourself using () of () sensor
Ask () and Wait // REQUIRED
Broadcast () and Wait // set a variable at the end of your broadcast and wait for it
Forever // use repeat until <1=1>
End
If () // use if, then, else
End
If () // https://scratch-mit-edu.ezproxy.canberra.edu.au/discuss/post/1955002/
Else
End
Play Sound () Until Done // REQUIRED
Repeat () // use repeat until + variable
End
Stop [ v] // REQUIRED
Repeat Until () // REQUIRED
End
Wait Until () // use repeat until
Play Drum () for () Beats // REQUIRED
Clear // REQUIRED
Move () Steps // use set x/y and sin/cos
[ v] of [ v]::sensing // REQUIRED
Item () of () // REQUIRED
Username // REQUIRED
Glide () Secs to X: () Y: () // use loop
Go Back () Layers // REQUIRED
Go to () // use () of () or mouse x/y
Go to X: () Y: () // REQUIRED
Direction // keep track yourself
Point in Direction () // REQUIRED
Hide // REQUIRED
Hide List () // REQUIRED
Hide Variable () // REQUIRED
Insert () at () of () // REQUIRED
Key () Pressed? // REQUIRED
Letter () of () // REQUIRED
Length of [ v]::list // REQUIRED
() Contains () // search yourself with loop
Switch Costume to () // REQUIRED
Set Instrument to () // REQUIRED
Mouse Down? // REQUIRED
Mouse X // REQUIRED
Mouse Y // REQUIRED
Next Costume // use switch costume
Next Backdrop // use switch backdrop
Not () // https://scratch-mit-edu.ezproxy.canberra.edu.au/discuss/post/1954949/
Play Note () for () Beats // REQUIRED
Set Pen Color to [#ffffff] // REQUIRED
Set Pen Size to () // REQUIRED
Play Drum () for () Beats // REQUIRED
Play Sound () // use play until done with broadcast
Point Towards () // point towards atan (x/y) of (thing)
Pen Down // REQUIRED
Pen Up // REQUIRED
Pick Random () to () // make own PRNG?
variable reporter::variables // REQUIRED
Rest for () Beats // use repeat until + days since 2000
Round () // floor/ceil
Say () // REQUIRED
Say () for () Secs // say [thing], wait using repeat until, say []
Size // keep track yourself
Backdrop Name // keep track yourself
Video () on () // REQUIRED
Set () Effect to () // REQUIRED
Replace Item () of () With () // use insert/delete
Set Pen Color to () // calculate hsl yourself
Set Pen Shade to () // same
Set Rotation Style () // REQUIRED
Set Size to ()% // REQUIRED
Set Tempo to () bpm // REQUIRED
Set () to () // REQUIRED
Turn Video () // REQUIRED
Set Video Transparency to ()% // REQUIRED
Set Volume to ()% // REQUIRED
Show // REQUIRED
Show List () // REQUIRED
Show Variable () // REQUIRED
Loudness // REQUIRED
Stamp // REQUIRED
Switch Backdrop to () // REQUIRED
Switch Backdrop to () and Wait // repeat until backdrop changed again
Stop All Sounds // REQUIRED
Length of ()::operators // loop as per theonlygusti
Tempo // keep track yourself
Think () // REQUIRED
Think () for () Secs // think [thing], repeat until to wait, think []
Current () // use days since 2000
Timer // use days since 2000 and offset variable
Reset Timer // REQUIRED (for hat block)
Days Since 2000 // REQUIRED
Touching ()? // REQUIRED
Touching Color ()? // REQUIRED
Turn cw () Degrees // use point towards
Turn ccw () Degrees // use point towards
Volume // keep track yourself
Wait () Secs // use repeat until + days since 2000
When This Sprite Clicked // REQUIRED
When I Start as a Clone // use stamps/lists
When Green Flag Clicked // REQUIRED
When I Receive () // REQUIRED
When () Key Pressed // REQUIRED
When Backdrop Switches to () // REQUIRED
When () > () // REQUIRED
X Position // keep track yourself
Set X to () // use go to
Y Position // keep track yourself
Set Y to () // use go to
If you see anything required that you have a reasonable workaround for (eg, using e^ and log for multiplication and division is not acceptable because of accuracy issues) let me know
Last edited by MegaApuTurkUltra (June 25, 2016 04:55:23)
$(".box-head")[0].textContent = "committing AT crimes since $whenever"
- Tymewalk
- Scratcher
1000+ posts
Fewest amount of blocks technically needed to use Scratch
… And there's your answer. Let me try to precisely define “Fewest amount of blocks technically needed to use Scratch”Fewest amount of blocks needed to exactly replicate the functionality of any normal Scratch project-snip-
There are probably still more that can be snipped out of this
*large round of applause*
Last edited by Tymewalk (April 26, 2016 21:04:01)
bold thing - italic thing - underlined thing - strikethrough thing
- bobbybee
- Scratcher
1000+ posts
Fewest amount of blocks technically needed to use Scratch
SUBLEQ
“Ooo, can I call you Señorita Bee?” ~Chibi-Matoran
- MegaApuTurkUltra
- Scratcher
1000+ posts
Fewest amount of blocks technically needed to use Scratch
But is it turing-complete? SUBLEQ
While it's nice, see my interpretation of “technically needed to use Scratch” above. In the spirit of actually identifying real workaroundable blocks, I suggest we stick with that.
Last edited by MegaApuTurkUltra (April 26, 2016 22:11:21)
$(".box-head")[0].textContent = "committing AT crimes since $whenever"
- herohamp
- Scratcher
1000+ posts
Fewest amount of blocks technically needed to use Scratch
Let mod scratch and only keep all the things MegaApuTurkUltra Dang that took a while to type correctly!
- WooHooBoy
- Scratcher
1000+ posts
Fewest amount of blocks technically needed to use Scratch
You can also remove the subtraction block because you can do
((x) + ((y) * (-1)))
considered harmful
- joefarebrother
- Scratcher
500+ posts
Fewest amount of blocks technically needed to use Scratch
All you need to make a turing machine are + and - (to which the 2nd argument only need to be 1), item() of
- , and replace item () of with (), if<>{} else{} (or if<>{} and stop ), and =. Loops can be achived by recursion on custom blocks, or broadcasts. (but with broadcasts, we'd need variables, which can be emulated with the list blocks we allow ourselves to use). Your states would be in the form:
(edit: I can't get the formatting to play nice, so just quote this to see what I actually wrote)define state1 (index)
if <(item (index) of [tape v]) = [desired symbol]>
replace item (index) of [tape v] with [new symbol]
state2 ((index) + (1))
else
if <(item (index) of [tape v]) = [another symbol]>
replace item (index) of [tape v] with [another new symbol]
state3 ((index) - (1))
else
...
end
end
You'd also need the green flag block to start this off.
I suppose at some point you're going to want to write something to the screen: then you'd just need go to and stamp, to print black pixels to the screen (make the costume a black pixel), and clear to wipe it. Alternatively, costumes for every colour pixel you want to use, then stamp. Don't need clear now as with a white pixel you can overwrite everything.
Then if you want some user input, (mouse x), (mouse y) and <mouse down?> will allow you to take mouse input. You can draw a virtual keyboard, and detect when it's clicked, so that gives you keyboard input too.
You might want to add in the blocks for cloud storage, camera detection, the lego motor and pico board plugins, to be able to do everything scratch can. Or course, extremely slowly.
Last edited by joefarebrother (April 26, 2016 23:05:55)
- PullJosh
- Scratcher
1000+ posts
Fewest amount of blocks technically needed to use Scratch
All clone functionality can be replicated with broadcasts, lists, and stamping. So you can remove that.
- scratchisthebest
- Scratcher
1000+ posts
Fewest amount of blocks technically needed to use Scratch
Variables? In that case(x position)
(y position)
(direction)
You can get rid of “not” because of this:
if <condition::sensing> then
else
do stuff :: sound
end
You can get rid of the “X of Y” sensing block because of variables as well.
“timer” can be done with “days since 2000”, minus an offset, and rounded to three decimal places.
I think “rest for x beats” can be done with just “wait x secs” as well (or vice versa if you're crazy)
I am a Lava Expert
- PullJosh
- Scratcher
1000+ posts
Fewest amount of blocks technically needed to use Scratch
Does this work in all situations? I can't think of any specific examples, but it seems like a “not” included inside of a massive tree of logic gates wouldn't be able to re replicated with this… You can get rid of “not” because of this:if <condition::sensing> then
else
do stuff :: sound
end
- scratchisthebest
- Scratcher
1000+ posts
Fewest amount of blocks technically needed to use Scratch
You could nest more if/else blocks, I think?Does this work in all situations? I can't think of any specific examples, but it seems like a “not” included inside of a massive tree of logic gates wouldn't be able to re replicated with this… You can get rid of “not” because of this:if <condition::sensing> then
else
do stuff :: sound
end
Last edited by scratchisthebest (April 26, 2016 23:42:31)
I am a Lava Expert
- Firedrake969
- Scratcher
1000+ posts
Fewest amount of blocks technically needed to use Scratch
I would assume so… It would be super ugly though.
Working around “and” is easy - nest “if” blocks
Working around “or” is also fairly easy - “if condition one {}”, “if condition two {}”
And doing “not” is shown above
Working around “and” is easy - nest “if” blocks
Working around “or” is also fairly easy - “if condition one {}”, “if condition two {}”
And doing “not” is shown above
'17 rickoid
bf97b44a7fbd33db070f6ade2b7dc549
- Discussion Forums
- » Advanced Topics
- » Fewest amount of blocks technically needed to use Scratch