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

#4276 2011-12-09 03:00:01

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

Re: BYOB 3 - Discussion Thread

MathWizz wrote:

Try making a block with a one letter name.  tongue

So?


Jens Mönig

Offline

 

#4277 2011-12-09 07:20:16

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

Re: BYOB 3 - Discussion Thread

the cap block just looks weird, i guess  smile

Offline

 

#4278 2011-12-09 15:50:39

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

Re: BYOB 3 - Discussion Thread

Custom block modification :
Once your first block is made, how to change it ?
1 - right-click and select CustomCommandBlockMorph
2 - then select edit ..and then the block screens re-appears !

Offline

 

#4279 2011-12-09 15:55:26

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

Re: BYOB 3 - Discussion Thread

yes, thanks for pointing out this half-done feature, Xavier! Currently you can only modify the custom block's body, though, not it's header (the prototype block), but eventually we'll have it all...


Jens Mönig

Offline

 

#4280 2011-12-11 03:32:52

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

Re: BYOB 3 - Discussion Thread

At this stage Snap! offers the "custom block" capability with set foo + C-script + its #1,#2..variables (named varfunc) Two drawbacks : 1 -call/run this block 2- with a dozen of long varfuncs the Script Area becomes rapidly crowdy. But I must admit that Snap! handles this "crowd" very efficiently , better than Byob.
The new block feature at this stage is far from offering all Byob block capabilities which will come sooner or later, but at least it has the merit of cleaning the Script area.
The question is :" how to pass parameters to block which has no  "variables" ?
What you can do :
1- Define a script within a varfunc + #1,#2
2 - Copy this script inside the new Block.
3 - Replace inside C-Shape the former script by the new "block" script.
4 - Run/Call this modified varfunc+block ...with #1, #2 ..
The varfunc parameters are passed directly to the block !
No practical interest !

Offline

 

#4281 2011-12-12 03:42:34

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

Re: BYOB 3 - Discussion Thread

@Jens
Since the beginning Snap! presents the same "bug" which is becoming more annoying as others are progressively fixed. It is related with "variable handling". From time to time when you open the pick-list to select a variable, either global or local (Script variables) Spap! blocks severelely with no possibility to recover it. My impression, is that this occurs when handle your variables too quickly ( which is the case after retyping one application which was blocked just before).
Except that Snap! is becoming very safe.

Offline

 

#4282 2011-12-12 04:10:31

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

Re: BYOB 3 - Discussion Thread

To illustrate my previous msg :
http://www.xleroy.net/ByobTuto/New/Snap!/rob05Txt.gif

Offline

 

#4283 2011-12-12 05:59:01

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

Re: BYOB 3 - Discussion Thread

Hi Xavier,

I'm afraid I don't understand - and so far cannot reproduce - the bug you mention. When exactly will Snap freeze, when you select a variable name from the pulldown menu of a variable slot? Didn't it use to be when you try to add another variable blob to the palette? I can reproduce the latter bug (only sometimes) under Firefox for Windows (not on the Mac, though) and I suspect it has something to do with the needlessly complicated way I'm updating what will eventually become a true palette, at which time I expect everything to work correctly again.

The script is interesting. How do you access the inputs inside the "projb" block? This smells like cleverly hacking our hybrid scope feature  smile  Whaddaya say, Brian?


Jens Mönig

Offline

 

#4284 2011-12-12 08:10:18

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

Re: BYOB 3 - Discussion Thread

@Jens
1- when you select a variable name from the pulldown menu of a variable slot.
Yes, exactly.Not easy to reproduce as it does not happen each time !!

2 - Didn't it use to be when you try to add another variable blob to the palette?
Not now. This was a regular bug, but I've not had it since a while !

3 - How do you access the inputs inside the "projb" block ?
I'm afraid that the method is not worthy of Snap! I write the script inside the C-shape with its Input variables, then I copy this script "as it is" into the block window, and replace the initial script by the block inside the C-Shape.

Offline

 

#4285 2011-12-12 08:25:39

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

Re: BYOB 3 - Discussion Thread

Thanks, Xavier, I'll investigate. Meanwhile check out the beginnings of custom reporters...


Jens Mönig

Offline

 

#4286 2011-12-12 10:39:26

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

Re: BYOB 3 - Discussion Thread

cool!

did you know the exponent of 170 is the highest exponent calculateable in snap?

@USC: they finally responded and i sent a fixed version, fixing the icon bug  smile
if you want to replace it, it's not really a big update though  smile

Offline

 

#4287 2011-12-12 11:14:32

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

Re: BYOB 3 - Discussion Thread

@Jens "Meanwhile check out the beginnings of custom reporters..."
Find attached the first answer. The reporter Block ...reports !!
[img]Meanwhile check out the beginnings of custom reporters...[/img]

Offline

 

#4288 2011-12-12 11:15:55

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

Re: BYOB 3 - Discussion Thread

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

Offline

 

#4289 2011-12-12 11:23:14

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

Re: BYOB 3 - Discussion Thread

Really, change "predicate" in make a block to "boolean". Because I got REALLY confused when I first used BYOB and, it makes sense much more.


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

Offline

 

#4290 2011-12-12 14:09:53

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

Re: BYOB 3 - Discussion Thread

Jens wrote:

How do you access the inputs inside the "projb" block? This smells like cleverly hacking our hybrid scope feature  smile  Whaddaya say, Brian?

Indeed, it's using dynamic scope.  This is precisely the sort of situation dynamic scope is for!  So I wouldn't have said "cleverly hacking," just using it!

But using the default names (#1 etc) dynamically is asking for trouble, because at some point you'll use this block inside another script that also uses those names and then there will be same-name variables in scope lexically and they'll win.  You want to use unusual names for your dynamically scoped variables.


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

Offline

 

#4291 2011-12-12 14:16:43

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

Re: BYOB 3 - Discussion Thread

iTweak0r wrote:

Really, change "predicate" in make a block to "boolean". Because I got REALLY confused when I first used BYOB and, it makes sense much more.

I understand your point, but technically it's not right.  "Boolean" means "true or false"; there are only two Boolean values.  "Predicate" means "a function that returns a Boolean value."  For example, "<" is a predicate.

Even the green operator "true" and "false" blocks are technically predicates, not Booleans (which btw is conventionally capitalized because it comes from a person's name, George Boole, who invented the formal algebra of true/false values); they are functions taking no inputs and always returning the same value.  In BYOB we represent the values true and false by the strings "true" and "false" (try clicking on the TRUE block and see what you get), but really that's wrong; we should have a distinct pictorial representation of true and false values.


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

Offline

 

#4292 2011-12-12 18:09:30

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

Re: BYOB 3 - Discussion Thread

@Jens
At the end of a rather long application I've had the palette spoiled (its color turns black and the "blobs" are no more active). It is a rather frequent problem. Snap! does not freeze but the palette blocks are no more active. This time it was possible to recover from the situation (palette suddenly becoming normal) but Snap! was spoiled. Soon later it froze definitevely. If needed I have made a screen capture.

Offline

 

#4293 2011-12-13 05:35:51

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

Re: BYOB 3 - Discussion Thread

Snap! update - call/cc now works within lambdas and custom blocks


Jens Mönig

Offline

 

#4294 2011-12-13 06:22:29

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

Re: BYOB 3 - Discussion Thread

@bharvey says : "But using the default names (#1 etc) dynamically is asking for trouble, because at some point you'll use this block inside another script that also uses those names and then there will be same-name variables in scope lexically and they'll win.  You want to use unusual names for your dynamically scoped variables."

At this very preliminary stage "blocks" replace a long script inside a "set var +c-shape script" by only one instruction (in the old days the Scratch team was satisfied with this simple block enhancement ). But as blocks have not yet their own "input variables it is a walkaround to pass to blocks input variables.If the present block definition were definitive, you're are right  we should take care of more appropriate names for c-shape input variables .

Offline

 

#4295 2011-12-13 06:25:01

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

Re: BYOB 3 - Discussion Thread

@ bharvey
"Snap! update - call/cc now works within lambdas and custom blocks"
Can you give us a simple example of this feature which did not exist in Byob - as far as I know ?

Offline

 

#4296 2011-12-13 12:15:38

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

Re: BYOB 3 - Discussion Thread

There should be an "are you sure?" dialogue box when you select "delete block definition"


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

 

#4297 2011-12-13 12:39:44

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

Re: BYOB 3 - Discussion Thread

xly wrote:

@ bharvey
"Snap! update - call/cc now works within lambdas and custom blocks"
Can you give us a simple example of this feature which did not exist in Byob - as far as I know ?

Right, this is a new feature taken from Scheme.  Start here:

http://scratch.mit.edu/forums/viewtopic … 05#p952305

for an explanation of what a continuation is.

My favorite simple example is this:  First the "before" picture of a script that uses call⁄cc.

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

The script says, put the pen down, turn 30 plus however many degrees the script inside the call⁄cc reports, then move 50 steps.  Here's what you see after running it:

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

The sprite has turned 30+60 degrees and moved 50 steps, and variable FOO now contains the continuation of the call⁄cc block, namely, what remains to be done after it reports a value.

By the way, the picture in the FOO watcher is wrong (Jens...).  It should look like this:

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

This value in FOO is now runnable:

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

This time the sprite turns 30+15 degrees and moves 50 steps.

What Jens has fixed is that you can now use call⁄cc from inside a custom block:

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


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

Offline

 

#4298 2011-12-13 14:37:02

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

Re: BYOB 3 - Discussion Thread

joefarebrother wrote:

There should be an "are you sure?" dialogue box when you select "delete block definition"

Absolutely. I just added one, thanks for the suggestion, joefarebrother!


Jens Mönig

Offline

 

#4299 2011-12-14 08:14:34

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

Re: BYOB 3 - Discussion Thread

*second bug report*

calling scripts without a report block still doesn't generate an error massage, instead it goes into an infinite loop  tongue

Offline

 

#4300 2011-12-14 08:36:22

Sidharth
Scratcher
Registered: 2007-12-14
Posts: 100+

Re: BYOB 3 - Discussion Thread

Weird sprite bug:

http://i.imgur.com/HXdiM.png

I was messing with block specs and did that.

Can someone explain what happened to the sprite when a %c was passed into the direction block instead of %dir?

EDIT: Yes, the line is the sprite. It turned into a line.

Last edited by Sidharth (2011-12-14 08:37:05)


http://www.danasoft.com/citysign.jpg

Offline

 

Board footer