Discuss Scratch

PullJosh
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

bobbybee wrote:

PullJosh wrote:

MegaApuTurkUltra wrote:

I've removed show/hide watcher blocks because they can (with a bit of difficulty) be replicated with pen
Are we assuming, then, that speed of rendering isn't important?

Edit: Also, new relevant siggy text.
I think that was an assumption from the beginning
I guess I'm just a little slow…
HA HA HA PEN RENDERING SADNESS JOKE HA
bobbybee
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

PullJosh wrote:

bobbybee wrote:

PullJosh wrote:

MegaApuTurkUltra wrote:

I've removed show/hide watcher blocks because they can (with a bit of difficulty) be replicated with pen
Are we assuming, then, that speed of rendering isn't important?

Edit: Also, new relevant siggy text.
I think that was an assumption from the beginning
I guess I'm just a little slow…
HA HA HA PEN RENDERING SADNESS JOKE HA
Well, I suppose if we change some initial rules, I can do it in one block:

interpret base64 () as sb2 :: control

“Ooo, can I call you Señorita Bee?” ~Chibi-Matoran
MegaApuTurkUltra
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

And here's a full list of what's required and what needs workarounds. For the sake of laziness, I copied this off block selectors and didn't bother to make things reporters. You get the idea

() - () // use join[-](number)
() * () // REQUIRED
() / () // https://scratch.mit.edu/discuss/post/1955358/
() and () // https://scratch.mit.edu/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/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/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:53:57)


$(".box-head")[0].textContent = "committing AT crimes since $whenever"
djdolphin
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

MegaApuTurkUltra wrote:

Not () // REQUIRED
You can do something like
<<...> = <[1] = [0]>>

!
theonlygusti
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

MegaApuTurkUltra wrote:

I've removed show/hide watcher blocks because they can (with a bit of difficulty) be replicated with pen
Then go ahead and remove all the looks blocks too, and the touching blocks, as they can all be re-done using pen :roll:

PullJosh
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

if <condition :: motion> then
when true :: grey
else
when false :: grey
end

Can be replaced with this:
set [genericVar v] to [0]
repeat until <<condition :: motion> or <(genericVar) = [1]>>
when false :: grey
set [genericVar v] to [1]
end
repeat until <(genericVar) = [1]>
when true :: grey
set [genericVar v] to [1]
end

Edit: You'd have to replace the variables with one-item lists as discussed previously, but that's too tedious to write out atm. Just imagine it.

Last edited by PullJosh (April 30, 2016 17:41:44)

PullJosh
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

If we want to be backwards-compatible, we need to support forever-if and loud?, but those are both easy.

forever if <condition :: motion>

end
becomes

repeat until <[1] = [0]> // This is a forever
set [genericVar v] to [0] // And this is just my if, else from above
repeat until <<condition :: motion> or <(genericVar) = [1]>>
set [genericVar v] to [1]
end
repeat until <(genericVar) = [1]>
when true :: grey
set [genericVar v] to [1]
end
end

<loud?>
would become
<(loudness) > [30]> // Selected 30 b/c wiki said so
Loud? <– I just used the [wiki] tag!
theonlygusti
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

MegaApuTurkUltra wrote:

re: removing if/else and using repeat until: I'm not exactly clear on how that workaround would work. Pls explain?

if <condition :: operators> then
true :: grey
else
false :: grey
end

is

set [counter v] to (0 )
set [counter2 v] to (0)
repeat until <<(counter) = [1]> or <condition :: operators>>
change [counter v] by (1)
end
repeat until <<(counter) = [1]> or <(counter2) = [1]>>
true :: grey
change [counter2 v] by (1)
end
repeat until <(counter2) = [1]>
false :: grey
change [counter2 v] by (1)
end

re: using e^/log for * and /: I'd worry about accuracy

Yes, I tried multiplying 4 by 5 and it gave me 19.999999999997 using my technique. [Removed ಠ_ಠ] you Scratch, why can't you use Wolfram as your maths engine?

Surely only / is required though, a/(1/b) = a*b? Or is this also inaccurate…..

I've removed show/hide watcher blocks because they can (with a bit of difficulty) be replicated with pen

Nope. Just nope. Then everything can be replicated with pen (which is not true)

Last edited by Harakou (April 30, 2016 18:54:07)


theonlygusti
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

PullJosh wrote:

Loud? <– I just used the [wiki] tag!
That's awesome! I didn't know that existed,

theonlygusti
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

Also MegaApuTurkUltra are you sure you need the and block?

<<(a) = <(b) < (b)>> < (b)>

seems to work for me.

EDIT: I broke the renderer. Here it is:

Last edited by theonlygusti (April 30, 2016 18:04:09)


MegaApuTurkUltra
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

Ok, I added back watcher blocks, and added your suggestions

Last edited by MegaApuTurkUltra (April 30, 2016 18:07:56)


$(".box-head")[0].textContent = "committing AT crimes since $whenever"
epicanna27
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

Technically, you wouldn't need much.
To make Scratch still easy, you'd still need all the costumes and stuff.

Although, there are tons of useless blocks. I have a least favorite Scratch block:
if on edge, bounce

sorry guys

i fed my signature to my pet kumquat

but he is still hungry so hide your signatures kids
CodeLegend
Scratcher
500+ posts

Fewest amount of blocks technically needed to use Scratch

@MegaApuTurkUltra…

Does
((a) / ((1) / (b)))
Count as an adequate workaround for the multiplication block? I haven't payed much attention to rounding details in the past.


EDIT:

I've also seen projects that use a certain pen color to remove pen trails and show the background, although I can't remember where. This could make the clear block unnecessary.

EDIT:

Also, I can't think of any time when the background would change without this being caused by a script, so is the [when background switches to ] necessary? You could just add a broadcast whenever something changes the background.

Last edited by CodeLegend (April 30, 2016 19:19:40)

Firedrake969
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

Something along the lines of “if b is 0, return 0, else return a/(1/b)” would work for multiplication I guess

'17 rickoid

bf97b44a7fbd33db070f6ade2b7dc549
PullJosh
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

Firedrake969 wrote:

Something along the lines of “if b is 0, return 0, else return a/(1/b)” would work for multiplication I guess
(<<(b) = [0]> = <[1] = [0]>> * ((a) / ((1) / (b))))
MegaApuTurkUltra
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

PullJosh wrote:

Firedrake969 wrote:

Something along the lines of “if b is 0, return 0, else return a/(1/b)” would work for multiplication I guess
(<<(b) = [0]> = <[1] = [0]>> * ((a) / ((1) / (b))))
Ok, added

I love your sig :P

So far, 67 out of 140 blocks are eliminated. Almost 50%!

Last edited by MegaApuTurkUltra (April 30, 2016 21:10:20)


$(".box-head")[0].textContent = "committing AT crimes since $whenever"
Jonathan50
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

Any C program, recursive or not, will run out of stack frames given a small enough stack size

Not yet a Knight of the Mu Calculus.
theonlygusti
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

MegaApuTurkUltra wrote:

PullJosh wrote:

Firedrake969 wrote:

Something along the lines of “if b is 0, return 0, else return a/(1/b)” would work for multiplication I guess
(<<(b) = [0]> = <[1] = [0]>> * ((a) / ((1) / (b))))
Ok, added

I love your sig :P

So far, 67 out of 145 blocks are eliminated. Almost 50%!
I eliminated 86; why is there such a large discrepancy between our answers?

Last edited by theonlygusti (April 30, 2016 23:18:34)


MegaApuTurkUltra
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

theonlygusti wrote:

MegaApuTurkUltra wrote:

PullJosh wrote:

Firedrake969 wrote:

Something along the lines of “if b is 0, return 0, else return a/(1/b)” would work for multiplication I guess
(<<(b) = [0]> = <[1] = [0]>> * ((a) / ((1) / (b))))
Ok, added

I love your sig :P

So far, 67 out of 145 blocks are eliminated. Almost 50%!
I eliminated 86; why is there such a large discrepancy between our answers?
Pls explain the workarounds you have?

$(".box-head")[0].textContent = "committing AT crimes since $whenever"
liam48D
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

Hey, maybe I'll just make a list everybody can use.

Oh wait..



202e-202e-202e-202e-202e UNI-CODE~~~~~

Powered by DjangoBB