Discuss Scratch

roijac
Scratcher
100+ posts

M30W - Code Scratch with Scratchblocks!

Our Sourceforge page!

Where can I get it?
Linux (recommended):
sudo apt-get install python-pip python-wxgtk2.8
pip install M30W

Run using “M30W” from terminal or Alt+F2.

Windows:
We have windows installers here. However, there's a bug with python x64 installers that requires you to manually modify your registry. (instructions)

Mac:
install pip, then follow the linux instructions.

If you're not sure, you can get the code from our SF svn repo at

svn checkout https://svn.code.sf.net/p/m30w/svn/

You can run it using python M30W.py
If you have some trouble installing M30W, here is an excellent guide by Gravitation.

What are the dependencies? (Source code users)
M30W needs:
- python 2.7 (3.x support is NOT planned, nor 2.6 compatibility)
- kurt
- PIL
- wxPython version 2.8 or higher (Version 2.9 no more regularly tested)

Can I also help?
Yes, of course! Just post your sourceforge name, grab the code, and start working!
You can also help by reporting bugs on this page

Who are current developers?
  • roijac
  • davidkt

What is your current status?
We currently only support .sb files (old 1.x format)
We are aware of this problem, but our current focus is on the execution of scripts (And we're doing well)

Are you using any sort of bugtrackers? Where?
We use the sourceforge ticketing system at our sourceforge page.

Last edited by roijac (June 9, 2013 18:03:36)

scimonster
Scratcher
1000+ posts

M30W - Code Scratch with Scratchblocks!

Doesn't work on Fedora. I can't find the python-wxgtk2.8 package, even with RPMFusion. Also, the command is python-pip install M30W, but it's obviously missing a dependency.
roijac
Scratcher
100+ posts

M30W - Code Scratch with Scratchblocks!

scimonster wrote:

Doesn't work on Fedora. I can't find the python-wxgtk2.8 package, even with RPMFusion. Also, the command is python-pip install M30W, but it's obviously missing a dependency.
Sorry, I thought anyone that decided to use linux AND took the risk of using a non-debian based distro should actually know what he's doing. Never have I been so wrong

What's the dependency missing? Full output please?

Anyway, try this:
sudo yum install wxPython
The command IS pip install, python-pip is the package name.
davidkt
Scratcher
1000+ posts

M30W - Code Scratch with Scratchblocks!

roijac wrote:

Who are current developers?
  • roijac
  • davidkt
Really? What happened to Magnie, slinger and aion5?
roijac
Scratcher
100+ posts

M30W - Code Scratch with Scratchblocks!

davidkt wrote:

roijac wrote:

Who are current developers?
  • roijac
  • davidkt
Really? What happened to Magnie, slinger and aion5?
They don't really… develop the program, you know? They're pretty much just interested in the project. Not offending or something, but they didn't write a single line of code (nor did you, but in you I still have faith )
davidkt
Scratcher
1000+ posts

M30W - Code Scratch with Scratchblocks!

Good. I had to reinstall Windows a few days ago(because I accidentally deleted a windows theme file) so I'll have to reinstall m30w.
P.S. I don't want to make the cmd-line version- I'm horrible with command-line stuff.
roijac
Scratcher
100+ posts

M30W - Code Scratch with Scratchblocks!

davidkt wrote:

Good. I had to reinstall Windows a few days ago(because I accidentally deleted a windows theme file) so I'll have to reinstall m30w.
P.S. I don't want to make the cmd-line version- I'm horrible with command-line stuff.
its not gonna be a cmdline version, you simlly need to handle things lke `M30W file.sb` a debug flag, the –help flag etc. it all stays pure python - look at argparse. other than that you can just imlement blocks (just make sure to tell me what exactly you implement so i wonf do that paralleled)
davidkt
Scratcher
1000+ posts

M30W - Code Scratch with Scratchblocks!

I can't save/load sb files- it raises a NoKurt, which I renamed to NoKurtError- it makes more sense. (And don't ask me to rename it to NoKurtException- this is Python, not Java or C++ or C# or any other languages that use that convention.) I looked further, importing kurt from the shell, and it looks like Kurt needs something called Construct. Why didn't you include that in the installer?

Last edited by davidkt (June 9, 2013 23:07:46)

davidkt
Scratcher
1000+ posts

M30W - Code Scratch with Scratchblocks!

roijac wrote:

davidkt wrote:

roijac wrote:

Who are current developers?
  • roijac
  • davidkt
Really? What happened to Magnie, slinger and aion5?
They don't really… develop the program, you know? They're pretty much just interested in the project. Not offending or something, but they didn't write a single line of code (nor did you, but in you I still have faith )
I see. So should I update the wiki page?
Magnie
Scratcher
100+ posts

M30W - Code Scratch with Scratchblocks!

roijac wrote:

davidkt wrote:

roijac wrote:

Who are current developers?
  • roijac
  • davidkt
Really? What happened to Magnie, slinger and aion5?
They don't really… develop the program, you know? They're pretty much just interested in the project. Not offending or something, but they didn't write a single line of code (nor did you, but in you I still have faith )
Yeah, at most I've helped test it and make a couple of images.
davidkt
Scratcher
1000+ posts

M30W - Code Scratch with Scratchblocks!

I know what I could do! I could modify Kurt for the M30W standards! And one of the first things I could do is remove that annoying “v” from the end of lists. I could give M30W a completely different syntax altogether…
blob8108
Scratcher
1000+ posts

M30W - Code Scratch with Scratchblocks!

davidkt wrote:

I could do is remove that annoying “v” from the end of lists.
Well, if you really want…
#blockspecs.py
block_plugin_inserts = dict((insert, fmt.replace(" v", "")) for (insert, fmt) in block_plugin_inserts.items())
Edit: syntax highlighting

Last edited by blob8108 (June 10, 2013 20:48:20)

roijac
Scratcher
100+ posts

M30W - Code Scratch with Scratchblocks!

davidkt wrote:

I see. So should I update the wiki page?
Go for it

davidkt wrote:

I know what I could do! I could modify Kurt for the M30W standards! And one of the first things I could do is remove that annoying “v” from the end of lists. I could give M30W a completely different syntax altogether…
I REALLY hate the scratchblocks syntax and how it's so messy and badly defined, but I also want to keep the nice feature of copy-paste into the forums. I should probably talk to ST, or whoever does it in S2.0.
@blob, is your thing at github to be official, is JSO updating his version or nXIII doing it?
blob8108
Scratcher
1000+ posts

M30W - Code Scratch with Scratchblocks!

roijac wrote:

I REALLY hate the scratchblocks syntax and how it's so messy and badly defined, but I also want to keep the nice feature of copy-paste into the forums. I should probably talk to ST, or whoever does it in S2.0.
Lightnin asked me to add scratchblocks2 to the forums — I just haven't managed to set up a local test server for the forums yet.

As for the syntax: what don't you like about it? It's easy to learn, and it has a pretty direct correspondence with the graphical blocks in Scratch: as text conversions go, I'd say it's pretty good. And it can be formally defined.

How would you design the syntax?
nXIII
Scratcher
1000+ posts

M30W - Code Scratch with Scratchblocks!

How would you design the syntax?
I made a parser a while ago that was a lot more logo-esque, i.e., it rarely used parentheses/brackets for grouping and relied on block information to parse code. For example:
move item n + 1 of amounts steps
set player 2 score to 1 + 3 / 2
Instead of:
move (item ((n) + (1)) of [amounts v]) steps
set [player 2 score v] to ((1) + ((3) / (2)))
blob8108
Scratcher
1000+ posts

M30W - Code Scratch with Scratchblocks!

nXIII wrote:

How would you design the syntax?
I made a parser a while ago that was a lot more logo-esque, i.e., it rarely used parentheses/brackets for grouping and relied on block information to parse code.
Ah yes, you said. And then you refused to show me the code.

I definitely agree with you there: if one can do it, then your parser has a much better syntax. I still can't quite figure out how to combine TDOP with mixfix blocks. Did you use TDOP or recursive decent or a parser generator or some other custom homemade algorithm?

Maybe I should even rewrite scratchblocks2's parser in the same way… though the existing block plugins both render exactly what you type, and don't actually validate the code in any way, so it would be a slight change in philosophy.
blob8108
Scratcher
1000+ posts

M30W - Code Scratch with Scratchblocks!

I found a paper that looks relevant, but these things are hard to read…
nXIII
Scratcher
1000+ posts

M30W - Code Scratch with Scratchblocks!

blob8108 wrote:

nXIII wrote:

How would you design the syntax?
I made a parser a while ago that was a lot more logo-esque, i.e., it rarely used parentheses/brackets for grouping and relied on block information to parse code.
Ah yes, you said. And then you refused to show me the code.
Oops! Here: http://dl.dropboxusercontent.com/u/10715865/tb/index.php (I apologize for the slightly messy coded quality. It also still doesn't parse a lot of stuff [e.g., my demo] correctly yet)

I definitely agree with you there: if one can do it, then your parser has a much better syntax. I still can't quite figure out how to combine TDOP with mixfix blocks. Did you use TDOP or recursive decent or a parser generator or some other custom homemade algorithm?
It's a recursive descent parser for the operators with a lot of homemade stuff for parsing the blocks.

Maybe I should even rewrite scratchblocks2's parser in the same way… though the existing block plugins both render exactly what you type, and don't actually validate the code in any way, so it would be a slight change in philosophy.
I think the current scratchblocks is good the way it is—you get exactly what you write, it's fast, and it's simple. I wrote my parser both as a test and and for large personal projects so I could write them quickly in a real text editor; I think it's less suited to everyday use for small scripts in the forums.
Hardmath123
Scratcher
1000+ posts

M30W - Code Scratch with Scratchblocks!

nXIII wrote:

blob8108 wrote:

nXIII wrote:

How would you design the syntax?
I made a parser a while ago that was a lot more logo-esque, i.e., it rarely used parentheses/brackets for grouping and relied on block information to parse code.
Ah yes, you said. And then you refused to show me the code.
Oops! Here: http://dl.dropboxusercontent.com/u/10715865/tb/index.php (I apologize for the slightly messy coded quality. It also still doesn't parse a lot of stuff [e.g., my demo] correctly yet)
That's a raw PHP file…
I definitely agree with you there: if one can do it, then your parser has a much better syntax. I still can't quite figure out how to combine TDOP with mixfix blocks. Did you use TDOP or recursive decent or a parser generator or some other custom homemade algorithm?
It's a recursive descent parser for the operators with a lot of homemade stuff for parsing the blocks.

Maybe I should even rewrite scratchblocks2's parser in the same way… though the existing block plugins both render exactly what you type, and don't actually validate the code in any way, so it would be a slight change in philosophy.
I think the current scratchblocks is good the way it is—you get exactly what you write, it's fast, and it's simple. I wrote my parser both as a test and and for large personal projects so I could write them quickly in a real text editor; I think it's less suited to everyday use for small scripts in the forums.
I've been messing with PEG.js, and I think it's powerful enough to work. If you want to be fancy, try Jison.
blob8108
Scratcher
1000+ posts

M30W - Code Scratch with Scratchblocks!

nXIII wrote:

Here:
Yay, I'll have a good read!

Maybe I should even rewrite scratchblocks2's parser in the same way…
I think the current scratchblocks is good the way it is—you get exactly what you write, it's fast, and it's simple. I wrote my parser both as a test and and for large personal projects so I could write them quickly in a real text editor; I think it's less suited to everyday use for small scripts in the forums.
That's true. The only downside, as roijac points out, is you can't paste your scripts into forum posts.

Powered by DjangoBB