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

#4026 2011-11-13 12:39:10

iTweak0r
Scratcher
Registered: 2011-07-30
Posts: 100+

Re: BYOB 3 - Discussion Thread

roijac wrote:

also, how long do you think it will take till blocks like <%item in %list> or (%n of %list)?

And [add [] to {list}] and [delete () of {list}]


Make it in Scratch! because it's cooler when it's made in scratch
http://i.imgur.com/D4iqPHR.png

Offline

 

#4027 2011-11-13 23:31:18

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

Re: BYOB 3 - Discussion Thread

iTweak0r wrote:

roijac wrote:

also, how long do you think it will take till blocks like <%item in %list> or (%n of %list)?

And [add [] to {list}] and [delete () of {list}]

smile


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

Offline

 

#4028 2011-11-14 00:47:14

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

suggestion:

(length()) instead of (length of ())
<() in ()> instead of <() contains ()>
(() of ()) instead of (item () of ())
(()>) instead of (list()>)
will make scripts MUCH shorter. also you can make length of polymorphic to strings, and <() in ()> could also make string processing easier  big_smile

Last edited by roijac (2011-11-14 00:48:36)

Offline

 

#4029 2011-11-14 01:00:11

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

Re: BYOB 3 - Discussion Thread

Hardmath123 wrote:

Hardmath123 wrote:

An explanation of some abstract BYOB blocks. Please check it out!

^^ This got buried under the list excitement...  tongue

I saw this the first time, but I've kind of been putting off replying to it because... I have a couple of disagreements with your explanation, and I was afraid I'd either hurt your feelings or start an argument.  But here goes:

1.  Explaining the BYOB blocks in terms of Javascript code doesn't really help our intended audience, who aren't JS programmers.  If a reader understands the JS "function" notation, then s/he isn't going to have any trouble with THE BLOCK or THE SCRIPT.

2.  More seriously, you conflate the creation of a procedure with assignment to a variable:  "This is used to set a variable to a script."  But the whole point of THE BLOCK and THE SCRIPT is that they make anonymous procedures.  Instead of comparing them to

Code:

var myScript = function(#1, #2)

you should just compare them to

Code:

function(#1, #2)

A typical use would be in conjunction with a higher order function, e.g.,

MAP [THE ... BLOCK] OVER ...


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

Offline

 

#4030 2011-11-14 04:32:02

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

Hardmath123 wrote:

Hardmath123 wrote:

An explanation of some abstract BYOB blocks. Please check it out!

^^ This got buried under the list excitement...  tongue

I saw this the first time, but I've kind of been putting off replying to it because... I have a couple of disagreements with your explanation, and I was afraid I'd either hurt your feelings or start an argument.  But here goes:

1.  Explaining the BYOB blocks in terms of Javascript code doesn't really help our intended audience, who aren't JS programmers.  If a reader understands the JS "function" notation, then s/he isn't going to have any trouble with THE BLOCK or THE SCRIPT.

2.  More seriously, you conflate the creation of a procedure with assignment to a variable:  "This is used to set a variable to a script."  But the whole point of THE BLOCK and THE SCRIPT is that they make anonymous procedures.  Instead of comparing them to

Code:

var myScript = function(#1, #2)

you should just compare them to

Code:

function(#1, #2)

A typical use would be in conjunction with a higher order function, e.g.,

MAP [THE ... BLOCK] OVER ...

Don't worry, I'm used to criticism. I knew I would have gotten 75% or more of the material wrong. Hey, that's how you learn!
Anyway, so I chose to explain in terms of JS because many people know JS as document.getElementById().value and alert(). Most 'JavaScripters' I've come across haven't even heard of functions or have no clue what they do. I tried to link them: if you understand the BYOB stuff, you'll learn some new JS. But I guess, in retrospect, you're right.
And I had no clue how a function() would be useful without it set to a variable. I use it only to assign methods to objects or make an array of functions.

So, thanks for the feedback, anyway.


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

Offline

 

#4031 2011-11-14 07:49:41

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Hardmath123 wrote:

EDIT: Oh, and can you add 25 pixels of blank space under the last block in the frame? It gets blocked by the scrollbar.

Offline

 

#4032 2011-11-14 13:36:44

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

Re: BYOB 3 - Discussion Thread

roijac wrote:

(length()) instead of (length of ())

Part of Scratch's heritage from Smalltalk is that it tries to make its primitive blocks readable rather than short.  In this case, I'm not convinced that saving three characters is really worth losing the self-documenting nature of this block.  But, you know, you can always write your own synonym!  smile

(()>) instead of (list()>)

I skipped over a couple where the issues are the same as for LENGTH: conciseness vs. self-documentingness.  But with LIST, I think your change would be really confusing, because to me a no-name reporter with one slot should mean the identity function, not one that wraps a list around its input.  So you are putting a heavy explanatory weight on that arrowhead.

you can make length of polymorphic to strings, and <() in ()> could also make string processing easier  big_smile

I've thought about that many times.  It does seem redundant to have LENGTH and CONTAINS and ITEM/LETTER () OF in both green and red versions.  But I feel that way only while writing a script.  When I'm reading a script, even one I wrote myself, I like the fact that the block color reminds me what the domain of the function is.

What do other people think?


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

Offline

 

#4033 2011-11-14 14:22:02

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

I've thought about that many times.  It does seem redundant to have LENGTH and CONTAINS and ITEM/LETTER () OF in both green and red versions.  But I feel that way only while writing a script.  When I'm reading a script, even one I wrote myself, I like the fact that the block color reminds me what the domain of the function is.

the idea is that the script won't care if it's a string or a list, and will handle strings as they were lists of letters  tongue

'bout the shorting, that's point of view  smile

Offline

 

#4034 2011-11-14 17:06:59

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: BYOB 3 - Discussion Thread

I just downloaded BYOB and think it's amazing.  I've run into a problem, though:  If you right-click a sprite's thumbnail and clone it, then try to make the clone the parent of the one you cloned, BYOB freezes.  I think it's probably an infinite loop.  Has anyone ever had this problem?   hmm

Offline

 

#4035 2011-11-14 18:23:44

xly
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: BYOB 3 - Discussion Thread

@Jens
Congratulations for your high responsiveness.
See my first LIST application = ALLBUTFIRST

http://www.xleroy.net/ByobTuto/New/Snap!/allbutfirst.gif

Offline

 

#4036 2011-11-14 18:46:43

xly
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: BYOB 3 - Discussion Thread

Now, it's UP to US play with LISTS .....

http://www.xleroy.net/ByobTuto/New/Snap!/mapg.gif

Offline

 

#4037 2011-11-14 19:09:47

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Yup, this is how I wanted lists to behave (there have been more optimizations tonight). Please note, that lists should behave much faster than in Scratch/BYOB, but only if you hide the watchers. Then you should be able to work with much larger lists than in Scratch or BYOB.


Jens Mönig

Offline

 

#4038 2011-11-15 05:52:19

xly
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: BYOB 3 - Discussion Thread

@Jens
It seems that if you want to create a variable bound to be a list you should beforehand set this variable to an empty list. Am I right ?

http://www.xleroy.net/ByobTuto/New/Snap!/elephlis.gif

Offline

 

#4039 2011-11-15 06:09:31

xly
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: BYOB 3 - Discussion Thread

@Jens
Several times I've had Snap! totally blocked just before clicking OK when using "Make a variable".

Offline

 

#4040 2011-11-15 12:28:59

xly
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: BYOB 3 - Discussion Thread

The following example shows that Snap! is convenient, stable and faster than Byob for this same application where script blocks are stored into a LIST.
I'm currently using Firefox last version.Aurora.

http://www.xleroy.net/ByobTuto/New/Snap!/robdraw.gif

- Click on C broadcast button to clear the previous shape LISCOM list before starting a new shape.
-Click on brodcast button, N, NE, E, SE etc to move the turtle.
- Click on the Script to redraw the shape.

Offline

 

#4041 2011-11-15 14:11:31

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

roijac wrote:

Hardmath123 wrote:

EDIT: Oh, and can you add 25 pixels of blank space under the last block in the frame? It gets blocked by the scrollbar.

not that hard, is it?  hmm

Offline

 

#4042 2011-11-15 14:13:20

14God
Scratcher
Registered: 2008-11-14
Posts: 100+

Re: BYOB 3 - Discussion Thread

Are save  files going to be cookies?


http://cs.berkeley.edu/~bh/sig4.png
Logic and reason have led me to atheism... but I'm stuck with the name  tongue

Offline

 

#4043 2011-11-15 16:44:08

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

Re: BYOB 3 - Discussion Thread

roijac wrote:

roijac wrote:

Hardmath123 wrote:

EDIT: Oh, and can you add 25 pixels of blank space under the last block in the frame? It gets blocked by the scrollbar.

not that hard, is it?  hmm

Yeah, yeah, we'll get there.  That sort of trivial UI tweak isn't high priority pre-alpha.  Everything reported here will be fixed in the beta.


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

Offline

 

#4044 2011-11-15 16:47:46

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

Re: BYOB 3 - Discussion Thread

14God wrote:

Are save  files going to be cookies?

Not cookies; Javascript has this sandboxed filesystem that's a bit cookie-like but allows bigger files.  I'm thinking there will be three options for saving:

1.  JS sandbox file.
2.  Send to web server (as plain text file).
3.  Download an auxiliary program that talks to Snap! via localhost TCP and allows storing to the real filesystem -- sort of a special case of #2 in which the web server runs on your own machine and interfaces to local files.

So, people behind a paranoid firewall can choose either of the first two, and people who trust the software (and the projects they download, which really is an issue) can have the more convenient #3.


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

Offline

 

#4045 2011-11-15 17:55:30

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

14God wrote:

Are save  files going to be cookies?

Not cookies; Javascript has this sandboxed filesystem that's a bit cookie-like but allows bigger files.  I'm thinking there will be three options for saving:

1.  JS sandbox file.
2.  Send to web server (as plain text file).
3.  Download an auxiliary program that talks to Snap! via localhost TCP and allows storing to the real filesystem -- sort of a special case of #2 in which the web server runs on your own machine and interfaces to local files.

So, people behind a paranoid firewall can choose either of the first two, and people who trust the software (and the projects they download, which really is an issue) can have the more convenient #3.

Or you could send it to the server and make JS download it and save it to the computer.


http://block.site90.net/scratch.mit/text.php?size=30&amp;text=%20A%20signature!&amp;color=333333

Offline

 

#4046 2011-11-16 01:08:19

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

logo  smile

Offline

 

#4047 2011-11-16 09:01:05

xly
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: BYOB 3 - Discussion Thread

@ bharvey &Jens - I like the Logo.
I've attached an update of this "robdraw" application where the "snap!" shape uses a list of 244 items. I've used extensively this application, with no problem. The responsiveness is satisfying and much better than with Byob.

http://www.xleroy.net/ByobTuto/New/Snap!/robsnap01Txt.gif

Offline

 

#4048 2011-11-16 09:11:39

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Hi Xavier,

Kudos! Once again you're pushing the pre-alpha version's envelope with awesome hacks! I'm really glad that you're designing these tough tests, especially since I've been hard at work optimizing list watchers in the past days (err, nights  smile  ).

Thanks for the great contribution!


Jens Mönig

Offline

 

#4049 2011-11-16 09:48:53

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: BYOB 3 - Discussion Thread

What kind of save format will you use? BYOB's' format or a new format just for Snap! ?


http://block.site90.net/scratch.mit/text.php?size=30&amp;text=%20A%20signature!&amp;color=333333

Offline

 

#4050 2011-11-16 09:52:52

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: BYOB 3 - Discussion Thread

MathWizz wrote:

What kind of save format will you use? BYOB's' format or a new format just for Snap! ?

It'll be similar to Scratch 2.0, probably JSON based. But we'll also provide ways to read and convert old projects.


Jens Mönig

Offline

 

Board footer