This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#7601 2013-03-31 18:32:16

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

blob8108 wrote:

I might need a superclass for both Script and Comment (for free-floating comments), as they're both things that can be added to the scripting area. Any thoughts?

Since comments can be attached to scripts, I've always thought of free-floating comments as being attached to empty scripts.  A comment is just another kind of block that connects sideways instead of vertically.

But a comment is attached to a specific block, not a script. So then I'd have to have a Script with a kind of "null" block, which has a comment attribute.

Block("say [Hello!] for (2) secs"), rather than the uglier Block('say:duration:elapsed:from:', 'Hello!', 2).

Yes of course that's way better!

But then the Block constructor has to use the parser, and the parser becomes an integral part of Kurt.  hmm

Snap! scripts are basically "nested tuples with the command name as the first item", the same as Scratch, right? (Is "S-expressions" the technical term?)

I think you mean "Snap! instructions" not "Snap! scripts"...

Gah, ask a stupid question  tongue

I meant a block is an S-expression, yeah. And then a list of blocks is a stack; a script is a stack; and stacks can be arguments to other blocks...

I like your explanation, but I don't get

Snap! wouldn't be written yet, so I don't get a vote.

And my question remains: are Snap!'s script data structures easily converted to Scratch-like ones, or not?  tongue


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#7602 2013-03-31 18:33:45

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Also, anyone feel like making a quick 1.4 insert-to-2.0 insert Python dictionary?  tongue

EDIT: whoops, broken link

Last edited by blob8108 (2013-03-31 18:34:01)


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#7603 2013-03-31 20:02:02

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

blob8108 wrote:

And then a list of blocks is a stack; a script is a stack; and stacks can be arguments to other blocks...

I've never liked the Scratch use of the word "stack" for a script, because it has a totally different meaning in non-Scratch CS circles.

I like your explanation, but I don't get

Snap! wouldn't be written yet, so I don't get a vote.

Oh, you know, Jens is an amazing programmer who turns out vast quantities of (working!) code in no time, so who am I to tell him how to do it?  I'm a mediocre programmer who's been lucky enough to sit at the feet of giants.  I just argue about the features and the UI.

And my question remains: are Snap!'s script data structures easily converted to Scratch-like ones, or not?  tongue

Umm, well, as you point out, at a certain level of abstraction it's all S-expressions.  (As for any language!)  But saved Scratch (1.4) projects aren't text files, unlike Snap! ones.  On the third hand, the primitives are largely the same, and so is the way blocks fit into other blocks.  Except, of course, on the fourth hand, for procedures as data.

So, yes and no.  tongue


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#7604 2013-04-01 06:56:06

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

blob8108 wrote:

And then a list of blocks is a stack; a script is a stack; and stacks can be arguments to other blocks...

I've never liked the Scratch use of the word "stack" for a script, because it has a totally different meaning in non-Scratch CS circles.

Yeah, good point. I'll try and avoid that.

And my question remains: are Snap!'s script data structures easily converted to Scratch-like ones, or not?  tongue

Umm, well, as you point out, at a certain level of abstraction it's all S-expressions.  (As for any language!)  But saved Scratch (1.4) projects aren't text files, unlike Snap! ones.  On the third hand, the primitives are largely the same, and so is the way blocks fit into other blocks.  Except, of course, on the fourth hand, for procedures as data.

We're assuming I've parsed the XML/JSON/objtable/whatever. What differences are there in the way the blocks fit together?

Basically, if I have a Block class that works like this:

    >>> block = kurt.Block('say:duration:elapsed:from:', 'Hello!', 2)
    >>> block.command
    'say:duration:elapsed:from:'
    >>> block.args
    ['Hello!', 2]

and a script class:

    class Script(object):
        pos = (10, 10)
        """(x, y) position from the top-left of the script area in pixels."""

        blocks = []
        """the list of Blocks."""

Is that flexible enough to store Snap! scripts?

(pseudo-Python for brevity)

EDIT: hahaha, beat teh confuzzifier

Last edited by blob8108 (2013-04-01 12:26:23)


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#7605 2013-04-01 07:51:08

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Yeah, I think it is, based on what I learned when making Snapin8r.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#7606 2013-04-01 08:06:04

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Hardmath123 wrote:

Yeah, I think it is, based on what I learned when making Snapin8r.

Sounds good.  smile


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#7607 2013-04-01 10:23:54

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

blob8108 wrote:

Is that flexible enough to store Snap! scripts?

You have to handle atomic types other than text and numbers: lists, Booleans, procedures.  If you can handle BYOB3, you can handle Snap!.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#7608 2013-04-01 10:47:28

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

blob8108 wrote:

Is that flexible enough to store Snap! scripts?

You have to handle atomic types other than text and numbers: lists, Booleans, procedures.  If you can handle BYOB3, you can handle Snap!.

Atomic types? Is that an argument to a block?


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#7609 2013-04-01 10:56:38

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

blob8108 wrote:

bharvey wrote:

blob8108 wrote:

Is that flexible enough to store Snap! scripts?

You have to handle atomic types other than text and numbers: lists, Booleans, procedures.  If you can handle BYOB3, you can handle Snap!.

Atomic types? Is that an argument to a block?

Sorry, it's early in the morning here... I meant "atomic expressions," input expressions that aren't calls to reporters, but just data.  But I guess it really boils down to procedures, because we don't have a way to quote a list (as opposed to calling the LIST reporter) nor to quote Booleans.  But the point is, when you drag a 2+3 block into a ring that's built into a block because the input was declared as a Procedure type, it means something different from the same block dragged into a Number-type input.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#7610 2013-04-01 11:16:52

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

I meant "atomic expressions," input expressions that aren't calls to reporters, but just data.  But I guess it really boils down to procedures, because we don't have a way to quote a list (as opposed to calling the LIST reporter) nor to quote Booleans.  But the point is, when you drag a 2+3 block into a ring that's built into a block because the input was declared as a Procedure type, it means something different from the same block dragged into a Number-type input.

But I can just wrap it in a "ring" Block and call it a Block, right? That's the point.

Last edited by blob8108 (2013-04-01 12:24:35)


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#7611 2013-04-01 11:25:51

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

blob8108 wrote:

But I can just wrap it in a "ring" Block and call it a Block, right? That's the point.

Yeah.  You just have to find out that you should do that by reading the type declarations of the inputs to the outer block.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#7612 2013-04-01 11:35:55

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

blob8108 wrote:

But I can just wrap it in a "ring" Block and call it a Block, right? That's the point.

Yeah.  You just have to find out that you should do that by reading the type declarations of the inputs to the outer block.

...ew.  tongue


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#7613 2013-04-01 12:15:31

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Ew about the Pico mess, or bharvey's proposition?  tongue

BTW 'Actors' and 'Stage' worked perfectly to explain Scratch to the kids I mentioned before.  smile  I also told them scripts were like stage directions.

And the Wi-Fi hack failed with Windows.  sad


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#7614 2013-04-01 12:21:07

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

blob8108 wrote:

...ew.

Actually, no, I'm wrong.  (That's twice this morning.  Maybe I should just go back to bed.)  Snap! has to do that, but by the time you're reading a saved project, the ringedness or not of a particular actual input expression has already been saved explicitly, just in case the user clicked "unringify."


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#7615 2013-04-01 12:23:32

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: BYOB 3 - Discussion Thread

this pico censor is a little annoying.


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#7616 2013-04-01 12:23:35

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Hardmath123 wrote:

Ew about the Pico mess, or bharvey's proposition?  tongue

What bharvey said.

BTW 'Actors' and 'Stage' worked perfectly to explain Scratch to the kids I mentioned before.  smile  I also told them scripts were like stage directions.

Cool, I'll keep `Actor`, then...

And the Wi-Fi hack failed with Windows.  sad

Which wifi hack?  sad

bharvey wrote:

by the time you're reading a saved project, the ringedness or not of a particular actual input expression has already been saved explicitly, just in case the user clicked "unringify."

Oh, sweet. That's good to know!  big_smile


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#7617 2013-04-01 12:25:40

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

This Wi-Fi hack.

I really feel sorry for people who just love Windows 8.  tongue


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#7618 2013-04-01 12:27:39

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Hardmath123 wrote:

I really feel sorry for people who just love Windows 8.  tongue

We got offered a copy for £20 or something ridiculous — they were basically giving it away...  tongue

Why couldn't Windows connect to your server? It has a browser, right...?  hmm

EDIT: excessive colon-p

Last edited by blob8108 (2013-04-01 12:28:01)


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#7619 2013-04-01 12:29:35

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: BYOB 3 - Discussion Thread

joefarebrother wrote:

this pico censor is a little annoying.

Yes. Yes it is.  tongue

bharvey wrote:

That's twice this morning.

I forget it's still morning in Berkeley. That's crazy.


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#7620 2013-04-01 12:32:47

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

blob8108 wrote:

Hardmath123 wrote:

I really feel sorry for people who just love Windows 8.  tongue

We got offered a copy for £20 or something ridiculous — they were basically giving it away...  tongue

Why couldn't Windows connect to your server? It has a browser, right...?  hmm

Who knows? Like 5 different computers just blankly said they couldn't connect to the server though they recognized it (but didn't ask for my password), but my friend's iPad, my iPad, my Mac, and my mom's Mac all worked perfectly.  hmm

EDIT: 'Stephen, I am not a psychologist.'

I doubt anyone but blob will get that.  tongue

Last edited by Hardmath123 (2013-04-01 12:34:55)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#7621 2013-04-01 12:37:23

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

blob8108 wrote:

I forget it's still morning in Berkeley. That's crazy.

I just had an idea for a Dashboard widget: a sort of time converter. You have two clocks, and a rough world map under each one. You pick a time zone for each clock, and then drag the hands of one clock to see the corresponding time on the other. There should also be a NOW button to set both clocks to the current time.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#7622 2013-04-01 12:46:29

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

blob8108 wrote:

That's crazy.

Nah, if you want crazy, it's already tomorrow in Japan!

EDIT: ... and so this April Fools business must be especially confusing.  tongue

Last edited by bharvey (2013-04-01 12:57:15)


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#7623 2013-04-01 13:18:32

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Meh, the wifi thing sounds weird.

Hardmath123 wrote:

'Stephen, I am not a psychologist.'

I doubt anyone but blob will get that.  tongue

Actually blob has no idea, either.  tongue  It's not off some TV programme, is it? I don't watch much TV... (he says, downloading Season 3 of White Collar off iTunes  big_smile )

Hardmath123 wrote:

I just had an idea for a Dashboard widget

I like the dragging-hands idea. It reminds me of the Minutes dashboard widget, which is the most decent timer I could find. Let me know when you finish your clock!  tongue

bharvey wrote:

if you want crazy, it's already tomorrow in Japan!

*dies of shock*

so this April Fools business must be especially confusing.

What, if you're Japanese?


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#7624 2013-04-01 13:50:17

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: BYOB 3 - Discussion Thread

I think I may have to make Stage an Actor, and this is terrible.


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#7625 2013-04-01 13:54:31

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

blob8108 wrote:

What, if you're Japanese?

Yeah.  Or Asian generally, I suppose.  Then again, WP says April Fools Day is a European tradition, so maybe Asians would be confused even if they were on the MIT side of the dateline.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

Board footer