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

#3901 2011-10-22 14:34:29

rubiks_cube_guy238
Scratcher
Registered: 2009-07-02
Posts: 100+

Re: BYOB 3 - Discussion Thread

Hardmath123 wrote:

http://www.imgpaste.com/r1N1.png

...

By any chance, could you give me the code for an individual block? I'd like to try making some Snap! blocks.

EDIT: I know about the empty hole in the Set block, I took that out before taking the picture. And yes, I did run the set one before.

The call block isn't needed.


The glass is never half full nor half empty; it is twice as large as it needs to be.

Offline

 

#3902 2011-10-22 15:14:45

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

Re: BYOB 3 - Discussion Thread

@Hardmath123

See also post #3859 et #3862

Offline

 

#3903 2011-10-22 15:35:16

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

Re: BYOB 3 - Discussion Thread

It's not a very good error message, but those are coming later.  You want just RUN [TREE], not RUN [CALL [TREE]].  CALL is for reporters, which Tree isn't.  smile

By any chance, could you give me the code for an individual block? I'd like to try making some Snap! blocks.

Load Snap! in your browser, then View Source, then click on objects.js to get the latest greatest.  But bear in mind that a lot of Control blocks that are currently handled as special cases will be regular blocks by the time we're done.


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

Offline

 

#3904 2011-10-22 16:21:10

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

Re: BYOB 3 - Discussion Thread

Taneb wrote:

ALSO also, the .deb installer doesn't work for me. I'm on Ubuntu 11.04, which may explain it, but still.

what error?
made on 11.10, works for me

Offline

 

#3905 2011-10-22 18:16:50

Taneb
Scratcher
Registered: 2009-07-07
Posts: 100+

Re: BYOB 3 - Discussion Thread

"Internal Error: The file could not be opened"

Offline

 

#3906 2011-10-22 19:49:09

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

Re: BYOB 3 - Discussion Thread

Taneb wrote:

"Internal Error: The file could not be opened"

Hmm, I wonder if there was a problem with my download.  The one on the web site is 2391793 bytes long; is that what it should be? (@roijac)


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

Offline

 

#3907 2011-10-23 03:07:08

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

Re: BYOB 3 - Discussion Thread

@Jens
When I decided to rewrite my fractals examples from Byob to Snap! I thought it was a simple formality. In  fact it took me hours. The trick is that with Snap!  - contrarily to Byob and Logo - you need to omit the final STOP of the IF part of the Script. See the result :
http://www.xleroy.net/ByobTuto/New/Snap!/ccurve.gif

Offline

 

#3908 2011-10-23 03:09:40

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

Re: BYOB 3 - Discussion Thread

@Jens
This is a typical example where a preudo byte-code would be an advantage.
No dobt that you will see that in due time !!

Offline

 

#3909 2011-10-23 04:03:41

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

Taneb wrote:

"Internal Error: The file could not be opened"

Hmm, I wonder if there was a problem with my download.  The one on the web site is 2391793 bytes long; is that what it should be? (@roijac)

yes, it's about 26 MB, try download it again  smile
http://dl.dropbox.com/u/38975042/BYOB-3-1-1.deb

Offline

 

#3910 2011-10-23 04:53:14

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

Re: BYOB 3 - Discussion Thread

xly wrote:

@Jens
When I decided to rewrite my fractals examples from Byob to Snap! I thought it was a simple formality. In  fact it took me hours. The trick is that with Snap!  - contrarily to Byob and Logo - you need to omit the final STOP of the IF part of the Script. See the result :
http://www.xleroy.net/ByobTuto/New/Snap!/ccurve.gif

show off  wink


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

Offline

 

#3911 2011-10-23 05:54:12

Taneb
Scratcher
Registered: 2009-07-07
Posts: 100+

Re: BYOB 3 - Discussion Thread

Well, that gave me a different error message. "The package is of bad quality: The installation of a package which violates the quality standards isn't allowed. This could cause serious problems on your computer. Please contact the person or organisation who provided this package and include the details beneath"

Offline

 

#3912 2011-10-23 07:36:55

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

Re: BYOB 3 - Discussion Thread

Taneb wrote:

Well, that gave me a different error message. "The package is of bad quality: The installation of a package which violates the quality standards isn't allowed. This could cause serious problems on your computer. Please contact the person or organisation who provided this package and include the details beneath"

try rename it to byob-3-1-1 (lower-case)
is it working now?

Offline

 

#3913 2011-10-23 07:56:05

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

Re: BYOB 3 - Discussion Thread

@jens, first input spot in a script/block seems to not accept inputs :S
will you add change colour by number option soon?

Offline

 

#3914 2011-10-23 08:34:49

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

Hardmath123 wrote:

By any chance, could you give me the code for an individual block? I'd like to try making some Snap! blocks.

Load Snap! in your browser, then View Source, then click on objects.js to get the latest greatest.  But bear in mind that a lot of Control blocks that are currently handled as special cases will be regular blocks by the time we're done.

And the code?

EDIT: Got it. Here's a block:

Code:

Process.prototype.reportExp = function (a, b) {
    return Math.pow(parseFloat(a), parseFloat(b));
};

blocks.push(block(
        'reporter',
        'operators',
        '%n ^ %n',
        'reportExp'
    ));

Last edited by Hardmath123 (2011-10-23 09:14:14)


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

Offline

 

#3915 2011-10-23 09:55:57

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

Re: BYOB 3 - Discussion Thread

xly wrote:

with Snap!  - contrarily to Byob and Logo - you need to omit the final STOP of the IF part of the Script.

That's because we don't yet have STOP BLOCK, as opposed to STOP SCRIPT.  It'll get there eventually.


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

Offline

 

#3916 2011-10-23 10:05:47

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

Re: BYOB 3 - Discussion Thread

roijac wrote:

rename it to byob-3-1-1 (lower-case)

I re-downloaded and put it on the BYOB page again.


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

Offline

 

#3917 2011-10-23 10:14:30

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

Re: BYOB 3 - Discussion Thread

Hardmath123 wrote:

Process.prototype.reportExp = function (a, b) {
     return Math.pow(parseFloat(a), parseFloat(b) );
};

The plan is that you're going to be able to do things like that this way:

http://cs.berkeley.edu/~bh/callJS.gif

The callJS block will figure out the data type of the inputs and do the appropriate conversion (such as parseFloat).


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

Offline

 

#3918 2011-10-23 11:27:34

shadow_7283
Scratcher
Registered: 2007-11-07
Posts: 1000+

Re: BYOB 3 - Discussion Thread

^ Cool!  big_smile

Last edited by shadow_7283 (2011-10-23 11:27:42)

Offline

 

#3919 2011-10-23 11:30:07

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

Hardmath123 wrote:

Process.prototype.reportExp = function (a, b) {
     return Math.pow(parseFloat(a), parseFloat(b) );
};

The plan is that you're going to be able to do things like that this way:

http://cs.berkeley.edu/~bh/callJS.gif

The callJS block will figure out the data type of the inputs and do the appropriate conversion (such as parseFloat).

I'm trying to make a block installer with a javascript:() bookmarklet which asks for the two codes. How do I edit the "function() =" with the 'blockspecs'? The code, I assume, can be added as a simple (global) function.


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

Offline

 

#3920 2011-10-23 13:55:47

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

Re: BYOB 3 - Discussion Thread

Hardmath123 wrote:

I'm trying to make a block installer with a javascript:() bookmarklet which asks for the two codes. How do I edit the "function() =" with the 'blockspecs'? The code, I assume, can be added as a simple (global) function.

Maybe I'm missing the point about bookmarklets.  What is the end goal you're trying to accomplish that the proposed callJS won't do?

The reason for this plan is that we hope to have a minimum of primitive blocks, extended by both our own and user-provided libraries that define other things as custom blocks.  We've even talked about moving some of the redundant Scratch blocks (e.g., CHANGE <var> BY <delta> ) into a library.  So, we want users to be able to customize the language with Snap!-level programming, rather than JS-level programming.  But there will be a lot of JS capabilities that couldn't be done entirely in Snap!, so we want one ring to... no, I mean, one block that will give access to the entire zoo of JS libraries.

But, for instance, we don't want to encourage users to import JS control structures (e.g., FOR loops); if it can be done in Snap!, then it should be (and it should run fast enough not to discourage users from relying on custom blocks).  Not that you shouldn't program in JS if you want, but if that's what you want you should fire up Emacs and write a .js file.


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

Offline

 

#3921 2011-10-23 17:31:41

rubiks_cube_guy238
Scratcher
Registered: 2009-07-02
Posts: 100+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

Hardmath123 wrote:

Process.prototype.reportExp = function (a, b) {
     return Math.pow(parseFloat(a), parseFloat(b) );
};

The plan is that you're going to be able to do things like that this way:

http://cs.berkeley.edu/~bh/callJS.gif

The callJS block will figure out the data type of the inputs and do the appropriate conversion (such as parseFloat).

Instead of this, why not add a block like (JavaScript[alert()]) that can be put into a call or run block. It looks nicer, and it adds one block instead of two (or three if a launch block is planned)

---------------------

bharvey wrote:

one ring to...

...rule them all?  tongue

Last edited by rubiks_cube_guy238 (2011-10-23 17:31:50)


The glass is never half full nor half empty; it is twice as large as it needs to be.

Offline

 

#3922 2011-10-23 22:05:41

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

Re: BYOB 3 - Discussion Thread

rubiks_cube_guy238 wrote:

Instead of this, why not add a block like (JavaScript[alert()]) that can be put into a call or run block. It looks nicer, and it adds one block instead of two (or three if a launch block is planned)

I think your version will have to be two shapes, too; no matter how you handle the JS side of the interface, the Snap! side of the interface distinguishes blocks that report values from ones that don't.

The reason to make it JS apply (call one function) rather than eval (run some piece of code) is that we are trying to provide access to low-level (e.g., hardware interface) primitives, rather than to encourage people to write whole scripts in JS instead of in blocks.

Of course people could do that anyway by writing a JS function in a private library and then using our apply block to call it, but nevertheless we think that the two possibilities encourage different programming styles.

bharvey wrote:

one ring to...

...rule them all?  tongue

Of course, what else did you think I meant??  hmm


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

Offline

 

#3923 2011-10-24 10:18:30

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

Hardmath123 wrote:

I'm trying to make a block installer with a javascript:() bookmarklet which asks for the two codes. How do I edit the "function() =" with the 'blockspecs'? The code, I assume, can be added as a simple (global) function.

Maybe I'm missing the point about bookmarklets.

Oh, a primitive bookmarklet that when fired asks for the block's code, then adds that block to the library. Just for fun.  big_smile


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

Offline

 

#3924 2011-10-24 11:14:33

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

Re: BYOB 3 - Discussion Thread

http://i.imgur.com/qUhWG.png
was bored  big_smile

Last edited by roijac (2011-10-24 11:17:00)

Offline

 

#3925 2011-10-24 11:31:19

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

Re: BYOB 3 - Discussion Thread

roijac wrote:

http://i.imgur.com/qUhWG.png
was bored  big_smile

That's cool.  smile  (pun...)  You know that the official Koch snowflake fractalizes the first and last section of each side, too, right?


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

Offline

 

Board footer