Discuss Scratch

blob8108
Scratcher
1000+ posts

Scratch project corpus

Many thanks to PullJosh for collecting projects for this!

Github repo: https://github.com/tjvr/scratch-corpus
Studio: https://scratch.mit.edu/studios/1869756/

Hi ATers!

I want to make sure tosh works with large (preferably all!) existing Scratch projects. I'm considering using automated testing to verify this. So I need a large sample of Scratch projects. Does someone happen to have such a corpus? The more diverse, the better: it'd be ideal if the projects are a variety of ages (older Scratch projects use more obscure features in the format) and complexity (more advanced projects tend to be more unusual, such as using stranger variable names).

Does anyone have anything like this, or should I roll my own?
Thanks!

Last edited by blob8108 (Dec. 12, 2016 14:35:05)


tosh · slowly becoming a grown-up adult and very confused about it
Hardmath123
Scratcher
1000+ posts

Scratch project corpus

Doesn't randomized shotgun testing against /projects/<N> work fine? What are the traits you're looking for in a “project corpus” that make it better than, y'know, all projects ever shared?

(more advanced projects tend to be more unusual, such as using stranger variable names)

Why? Presumably “Advanced” Scratchers are less likely to make a variable named “x position”.
blob8108
Scratcher
1000+ posts

Scratch project corpus

Hardmath123 wrote:

Presumably “Advanced” Scratchers are less likely to make a variable named “x position”.
From my experience so far, this is not the case. For example, I've seen a couple of “advanced” projects using “size” as an argument name. It's a completely reasonable thing to do, in Scratch…

I guess I was hoping that someone would already have a bunch downloaded, so I wouldn't have to hit the Scratch site repeatedly?

tosh · slowly becoming a grown-up adult and very confused about it
procd
Scratcher
100+ posts

Scratch project corpus

I did have a load but think I cleared lots out a while back. I'll check when I'm next on that computer. Best thing I found was to find the projects that interested you and try them. Soon found lots of different styles and ways of doing things and laziness….etc Random pickings also throws up some gems too as even some very simple beginner projects contain oddities.
kvackkvack
Scratcher
500+ posts

Scratch project corpus

blob8108 wrote:

Hardmath123 wrote:

Presumably “Advanced” Scratchers are less likely to make a variable named “x position”.
From my experience so far, this is not the case. For example, I've seen a couple of “advanced” projects using “size” as an argument name. It's a completely reasonable thing to do, in Scratch…

I guess I was hoping that someone would already have a bunch downloaded, so I wouldn't have to hit the Scratch site repeatedly?
How are you planning / how did you solve that issue? Did you do something like with scratch blocks, like size :: var or does it just guess itself?
procd
Scratcher
100+ posts

Scratch project corpus

Just looked and I'm afraid I've been even more brutal than I expected, so have lost many great test cases.

Here's an early one I remember https://scratch.mit.edu/projects/10052691 see if you can spot what caused a problem. (Just to clarify,the game is great and works in Scratch)
Jonathan50
Scratcher
1000+ posts

Scratch project corpus

blob8108 wrote:

For example, I've seen a couple of “advanced” projects using “size” as an argument name. It's a completely reasonable thing to do, in Scratch…
That's impossible in tosh!
blob8108
Scratcher
1000+ posts

Scratch project corpus

kvackkvack wrote:

how did you solve that issue?
You can only name variables certain things. When you import a Scratch project, if there are names that tosh doesn't like, it renames them so that the project can be imported.

tosh · slowly becoming a grown-up adult and very confused about it
gtoal
Scratcher
1000+ posts

Scratch project corpus

blob8108 wrote:

kvackkvack wrote:

how did you solve that issue?
You can only name variables certain things. When you import a Scratch project, if there are names that tosh doesn't like, it renames them so that the project can be imported.

PL/SQL allows any string as a variable name if enclosed in double-quotes. (text strings are single quotes). Super ugly but unambiguous.

G
Ethan_1
Scratcher
100+ posts

Scratch project corpus

This is a great question. I was thinking of this a few weeks ago. I think we of the ATers should make a studio or other place to make a “Scratch compatibility test”, a group of projects that we can run against to test compatibility with Scratch, for the projects that try to be compatible with Scratch. We could even select projects that are existing (of course).
Hardmath123
Scratcher
1000+ posts

Scratch project corpus

gtoal wrote:

blob8108 wrote:

kvackkvack wrote:

how did you solve that issue?
You can only name variables certain things. When you import a Scratch project, if there are names that tosh doesn't like, it renames them so that the project can be imported.

PL/SQL allows any string as a variable name if enclosed in double-quotes. (text strings are single quotes). Super ugly but unambiguous.

G
Or enclose longer names in {braces}.
scratchisthebest
Scratcher
1000+ posts

Scratch project corpus

Do you render the projects yourself (like phosphorus), or do you let Scratch's engine do it?

If you do it yourself, I remember this project used to break in Phosphorus because it uses really crazy hacky negative pen sizes https://scratch.mit.edu/projects/78262318/

I also have some very old Scratch projects, dating back to 1.3 if you're interested. Sadly they're not all that complex, so not really the best for testing features, but I guess you can see if they import right. I'll try not to touch them for fear of them converting to the 2.0 format (is that how that works?) I USED TO THINK THEY WERE SO COOL

Last edited by scratchisthebest (Feb. 12, 2016 15:33:03)


I am a Lava Expert
blob8108
Scratcher
1000+ posts

Scratch project corpus

scratchisthebest wrote:

Do you render the projects yourself (like phosphorus)
I am using phosphorus to play projects, in fact
dating back to 1.3 if you're interested […] I'll try not to touch them for fear of them converting to the 2.0 format (is that how that works?)
Yeah, if you “See Inside” on an old project the editor will convert it to 2.0.

Sadly tosh is only going to support 2.0 projects, but thank you for offering!

tosh · slowly becoming a grown-up adult and very confused about it
blob8108
Scratcher
1000+ posts

Scratch project corpus

Hardmath123 wrote:

Or enclose longer names in {braces}.
Ew, that *would* be ugly

tosh · slowly becoming a grown-up adult and very confused about it
Jonathan50
Scratcher
1000+ posts

Scratch project corpus

Wait
I have two custom blocks:
define foo (x)
...
define foo (x) (y)
...
I have three variables, one called ‘bar’, one called baz, and one called ‘bar baz’.
Now I call either of these blocks:
foo bar baz
Am I calling the first foo with one argument (bar baz) or the second foo with two arguments (bar, baz)?
Dylan5797
Scratcher
1000+ posts

Scratch project corpus

Use scratchapi (python) or scratch-api to download the json and test it.


Do assets matter?







im so ocd about ip addresses


can you guess what my user icon is

new record


dylan beswick · writing · github · soundcloud

I enjoy coding, writing electronic music, building computers and servers, and playing the piano. I am a big fan of F-777's music, you should really check it out.

I have written a few semi-common pieces of code that are used in scratch projects, like scratchapi.

I'm kind of lonely, I'd like a bit of attention, if that's possible.












i maxed out geoguessr at 25,000 points – https://geoguessr.com/results/GiXQHzXVQSEeWiYT
i truly feel sorry for everybody else in my country
gtoal
Scratcher
1000+ posts

Scratch project corpus

Jonathan50 wrote:

Wait
I have two custom blocks:
define foo (x)
...
define foo (x) (y)
...
I have three variables, one called ‘bar’, one called baz, and one called ‘bar baz’.
Now I call either of these blocks:
foo bar baz
Am I calling the first foo with one argument (bar baz) or the second foo with two arguments (bar, baz)?

Not having tried his system, but I would expect the syntax to be:

foo (bar baz)
foo (bar) (baz)

However you're on the right track - without some explicit quoting somewhere there are undoubtedly ambiguities to be found. (As have been in the past with other projects

G
BookOwl
Scratcher
1000+ posts

Scratch project corpus

gtoal wrote:

Jonathan50 wrote:

Wait
I have two custom blocks:
define foo (x)
...
define foo (x) (y)
...
I have three variables, one called ‘bar’, one called baz, and one called ‘bar baz’.
Now I call either of these blocks:
foo bar baz
Am I calling the first foo with one argument (bar baz) or the second foo with two arguments (bar, baz)?

Not having tried his system, but I would expect the syntax to be:

foo (bar baz)
foo (bar) (baz)

However you're on the right track - without some explicit quoting somewhere there are undoubtedly ambiguities to be found. (As have been in the past with other projects

G
The tosh code for that:
define foo (x arg) (y arg)

define foo (x arg)

when flag clicked
foo (bar) (baz)
foo (bar baz)
Here's a screenshot:

http://i.cubeupload.com/5tBfmb.png

Yes, I'm a tosh beta-tester…

Last edited by BookOwl (Feb. 13, 2016 23:23:21)


who needs signatures
Jonathan50
Scratcher
1000+ posts

Scratch project corpus

BookOwl wrote:

gtoal wrote:

Jonathan50 wrote:

Wait
I have two custom blocks:
-snip-
I have three variables, one called ‘bar’, one called baz, and one called ‘bar baz’.
Now I call either of these blocks:
foo bar baz
Am I calling the first foo with one argument (bar baz) or the second foo with two arguments (bar, baz)?

Not having tried his system, but I would expect the syntax to be:

foo (bar baz)
foo (bar) (baz)

However you're on the right track - without some explicit quoting somewhere there are undoubtedly ambiguities to be found. (As have been in the past with other projects

G
The tosh code for that:
define foo (x arg) (y arg)

define foo (x arg)

when flag clicked
foo (bar) (baz)
foo (bar baz)
Here's a screenshot:
http://i.cubeupload.com/5tBfmb.png

Yes, I'm a tosh beta-tester…
Oh, thanks.
You can just do [url]http://url[/url] instead of [url=http://url]http://url[/url]

Last edited by Jonathan50 (Feb. 13, 2016 23:26:30)

BookOwl
Scratcher
1000+ posts

Scratch project corpus

Jonathan50 wrote:


You can just do [url]http://url[/url] instead of [url=http://url]http://url[/url]
Thanks! I didn't know that.

who needs signatures

Powered by DjangoBB

Standard | Mobile