Discuss Scratch

MrJohnSmith
Scratcher
48 posts

Fun little challenge

I have a simple challenge for all of you to do.
Create a brainf*** interpreter without using booleans or C blocks.
All other blocks are allowed.

Don't submit your scratch extension to savaka's unofficial extension directory as submitting it will license it under a proprietary license.
-stache-
Scratcher
500+ posts

Fun little challenge

Lol I was thinking C blocks like
{
// code
}


3x3 pb: 13.240
3x3 avg: ~21-26
_nix
Scratcher
1000+ posts

Fun little challenge

Booleans most C blocks are pretty easy to implement with broadcasts and broadcast-tail-recursion:

when I receive [next character v]
broadcast (item (i) of [characters v]) and wait
broadcast [next character v] and wait

when I receive [> v]
code that handles \> :: grey

when I receive [< v]
code that handles \< :: grey

...

There's the starting point for anybody

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

Fun little challenge

Im going to do this!

I hope my post helped you in some way! Post count: 500+

Current project: [s3Blocks: scratchblocks rewritten for Scratch 3.0] ::#4b4a60 //https://scratch.mit.edu/discuss/topic/290031/ Basically done!
This is my signature identifier “aWFtbml0cm9jaXBoZXI=”
NitroCipher
Scratcher
500+ posts

Fun little challenge

Huh, how can I create a variable overflow from 255 to 0 without boolean… Boom. I've done it!

Last edited by NitroCipher (March 8, 2017 20:01:11)


I hope my post helped you in some way! Post count: 500+

Current project: [s3Blocks: scratchblocks rewritten for Scratch 3.0] ::#4b4a60 //https://scratch.mit.edu/discuss/topic/290031/ Basically done!
This is my signature identifier “aWFtbml0cm9jaXBoZXI=”
NitroCipher
Scratcher
500+ posts

Fun little challenge

MrJohnSmith wrote:

without using booleans or C blocks.

Sooo, am I allowed to do something like…

wait until (variable) //technically not a boolean...

I hope my post helped you in some way! Post count: 500+

Current project: [s3Blocks: scratchblocks rewritten for Scratch 3.0] ::#4b4a60 //https://scratch.mit.edu/discuss/topic/290031/ Basically done!
This is my signature identifier “aWFtbml0cm9jaXBoZXI=”
jokebookservice1
Scratcher
1000+ posts

Fun little challenge

NitroCipher wrote:

Huh, how can I create a variable overflow from 255 to 0 without boolean… Boom. I've done it!
Here is how I would have done it

when I receive [add one v]
broadcast (the variable) and wait
change [the variable v] by (1)

when I receive [255 v]
set [the variable v] to (-1)

NitroCipher wrote:

MrJohnSmith wrote:

without using booleans or C blocks.

Sooo, am I allowed to do something like…

wait until (variable) //technically not a boolean...
You can't drag a variable into a wait until block. Not in vanilla Scratch (with no hacks), anyway…
NickyNouse
Scratcher
1000+ posts

Fun little challenge

deja vu from https://scratch.mit.edu/discuss/topic/208146/ (where you couldn't use any data blocks)
NitroCipher
Scratcher
500+ posts

Fun little challenge

jokebookservice1 wrote:

NitroCipher wrote:

MrJohnSmith wrote:

without using booleans or C blocks.

Sooo, am I allowed to do something like…

wait until (variable) //technically not a boolean...
You can't drag a variable into a wait until block. Not in vanilla Scratch (with no hacks), anyway…

I know that, but does that mean im not allowed to?

I hope my post helped you in some way! Post count: 500+

Current project: [s3Blocks: scratchblocks rewritten for Scratch 3.0] ::#4b4a60 //https://scratch.mit.edu/discuss/topic/290031/ Basically done!
This is my signature identifier “aWFtbml0cm9jaXBoZXI=”
NitroCipher
Scratcher
500+ posts

Fun little challenge

I have no idea why, but scratch is not reading one of the +'s (or -'s for that matter) in my program. Does someone want to help me find the problem?
https://scratch.mit.edu/projects/149215604/
I fixed it by placing an empty wait block before each interpreter part.

Last edited by NitroCipher (March 9, 2017 17:34:31)


I hope my post helped you in some way! Post count: 500+

Current project: [s3Blocks: scratchblocks rewritten for Scratch 3.0] ::#4b4a60 //https://scratch.mit.edu/discuss/topic/290031/ Basically done!
This is my signature identifier “aWFtbml0cm9jaXBoZXI=”
gp469
Scratcher
4 posts

Fun little challenge

I know this is kind of a necropost, but it looked fun so here: https://scratch.mit.edu/projects/168964117/
Has infinite cell tape size as well.
Couldn't find a way to do it without booleans though, so it doesn't count.

Last edited by gp469 (July 16, 2017 09:03:27)

gp469-sensei
Scratcher
15 posts

Fun little challenge

I managed to now do the full challenge, without booleans or C blocks: https://scratch.mit.edu/projects/230472195/

I don't know how to detect ascii without using booleans or using a broadcast block for every ascii (which would take a long time, and I'm not willing to do) so input is just numeric.

Powered by DjangoBB