Discuss Scratch

Tymewalk
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

If we're talking about what's possible (not accounting for project size limits), you could probably replicate "say “ and ”think " with a text engine and some costumes for the bubbles in a custom block.

bold thing - italic thing - underlined thing - strikethrough thing
badatprogrammingibe
Scratcher
500+ posts

Fewest amount of blocks technically needed to use Scratch

define proc
proc

// You can use instead of the two above broadcast blocks, they work the same way
add [] to [list v]
delete ( v) of [list v]
<[ v] contains [thing] ?>
if <> then

else

end
These 6 blocks should be enough to implement a basic turing machine.
If scratch had proper bignumber support you could do it in 5.

Last edited by badatprogrammingibe (April 8, 2018 03:13:01)

Jonathan50
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

Please read the OP. The goal is to find the fewest amount of blocks you can recreate any Scratch project with (and it's nearly two years old!)

Not yet a Knight of the Mu Calculus.
badatprogrammingibe
Scratcher
500+ posts

Fewest amount of blocks technically needed to use Scratch

Jonathan50 wrote:

Please read the OP. The goal is to find the fewest amount of blocks you can recreate any Scratch project with (and it's nearly two years old!)
I was just showing what was needed to create a turing machine.
I never said that was all you need for every project, but I just thought that could help someone.

Last edited by badatprogrammingibe (April 8, 2018 03:42:17)

ScratchLover1029
Scratcher
60 posts

Fewest amount of blocks technically needed to use Scratch

so
 
change x by ()
=
move () steps
?
ScratchLover1029
Scratcher
60 posts

Fewest amount of blocks technically needed to use Scratch

these blocks are a forever loop
when I receive [loop v]
...
broadcast [loop v]
ScratchLover1029
Scratcher
60 posts

Fewest amount of blocks technically needed to use Scratch

badatprogrammingibe wrote:

Jonathan50 wrote:

Please read the OP. The goal is to find the fewest amount of blocks you can recreate any Scratch project with (and it's nearly two years old!)
I was just showing what was needed to create a turing machine.
I never said that was all you need for every project, but I just thought that could help someone
And in the previous post i showed you how to make a forever loop
ScratchLover1029
Scratcher
60 posts

Fewest amount of blocks technically needed to use Scratch

when I receive [loop v]
...
broadcast [loop v]

badatprogrammingibe wrote:

define proc
proc

// You can use instead of the two above broadcast blocks, they work the same way
add to
  • delete ( v) of < contains ?>
    if <> then

    else

    end


    These 6 blocks should be enough to implement a basic turing machine.
    If scratch had proper bignumber support you could do it in 5.


Last edited by ScratchLover1029 (April 8, 2018 10:22:00)

_nix
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

ScratchLover1029 wrote:

so
 
change x by ()
=
move () steps
?
Yup, almost – but the difference is that, if your sprite is pointed in a different direction, move () steps moves them forwards according to their direction. So the complete workaround is a bit more complicated:
define workaround for move (steps) steps in direction (dir)
go to x: ((x position) + (([sin v] of (dir)) * (steps))) y: ((y position) + (([cos v] of (dir)) * (steps)))

(Note that I also used “go to x: y:” instead of “change x by” and “change y by” separately – if I used them separately, and the pen down block is used before “workaround for move () steps in direction ()”, then a jagged line would be drawn instead of a straight one.

══ trans autistic lesbian enbydoggirls // 16 17 18 19 20, she/they
sparrows one word to the paragraph // <3 // ~(quasar) nebula
ScratchLover1029
Scratcher
60 posts

Fewest amount of blocks technically needed to use Scratch

_nix wrote:

ScratchLover1029 wrote:

so
 
change x by ()
=
move () steps
?
Yup, almost – but the difference is that, if your sprite is pointed in a different direction, move () steps moves them forwards according to their direction. So the complete workaround is a bit more complicated:
define workaround for move (steps) steps in direction (dir)
go to x: ((x position) + (([sin v] of (dir)) * (steps))) y: ((y position) + (([cos v] of (dir)) * (steps)))

(Note that I also used “go to x: y:” instead of “change x by” and “change y by” separately – if I used them separately, and the pen down block is used before “workaround for move () steps in direction ()”, then a jagged line would be drawn instead of a straight one.
Thanks for helping me!
ScratchLover1029
Scratcher
60 posts

Fewest amount of blocks technically needed to use Scratch

ScratchLover1029
Scratcher
60 posts

Fewest amount of blocks technically needed to use Scratch

...
What block should we recreate?
ScratchLover1029
Scratcher
60 posts

Fewest amount of blocks technically needed to use Scratch

((((((((((((((((((((((((((((((((((ScratchLover1029))))))))))))))))))))))))))))))))))
cool huh?
what block should we recreate?

Last edited by ScratchLover1029 (April 8, 2018 18:08:13)

ScratchLover1029
Scratcher
60 posts

Fewest amount of blocks technically needed to use Scratch

define block
...
block
herohamp
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

CodingWorker
Scratcher
7 posts

Fewest amount of blocks technically needed to use Scratch

The entire ‘More Blocks’ section is unneeded, as if you can define your block with Scratch blocks, you can copy and paste those Scratch blocks to where you wanted your custom block.
ihgfedcba
Scratcher
100+ posts

Fewest amount of blocks technically needed to use Scratch

CodingWorker wrote:

The entire ‘More Blocks’ section is unneeded, as if you can define your block with Scratch blocks, you can copy and paste those Scratch blocks to where you wanted your custom block.
But what if you have recursion? Then that would need infinite code?
ihgfedcba
Scratcher
100+ posts

Fewest amount of blocks technically needed to use Scratch

Scratch 3.0 introduces many differences onto this. For instance, hacked keys don't work, so it's impossible to fully workaround text input that's used by the ask prompt.

As for the note blocks, sounds can't workaround individual notes as it's impossible to play multiple sounds at once.

However, with theoretical overclocking it's however possible to play arbitrary sound:

define play sound from list at (FREQUENCY) Hz
set [play v] to [0]
repeat (length of [sound v])
change [play v] by [1]
if <(item (play) of [sound v])<[0]>::control
set volume to ((item (play) of [sound v])×[-100]::operators)%
play sound [negative sample v]
else
set volume to ((item (play) of [sound v])×[100]::operators)%
play sound [positive sample v]
end
wait ([1]÷(FREQUENCY)::operators) secs
ihgfedcba
Scratcher
100+ posts

Fewest amount of blocks technically needed to use Scratch

jokebookservice1 wrote:

PullJosh wrote:

CodeLegend wrote:

set rotation style (keep track of direction and rotation style and simulate rotation style)
Pretty sure this one is for flipping left/right.
You can just have two costumes, but I suppose that increases the file size so you can't perfectly emulate a very big project that is close to the file size limit.
File size limit is also workaroundable
Jonathan50
Scratcher
1000+ posts

Fewest amount of blocks technically needed to use Scratch

ihgfedcba wrote:

CodingWorker wrote:

The entire ‘More Blocks’ section is unneeded, as if you can define your block with Scratch blocks, you can copy and paste those Scratch blocks to where you wanted your custom block.
But what if you have recursion? Then that would need infinite code?
Recursive processes can be implemented with lists, conditionals, and looping (which can be done with broadcasts.) Here is an example on the wiki. But joefarebrother pointed out that you need custom blocks because of run without screen refresh.

Not yet a Knight of the Mu Calculus.

Powered by DjangoBB