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

#5776 2012-08-15 07:40:41

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

Re: BYOB 3 - Discussion Thread

Jens wrote:

dasbloekendeschaf wrote:

Hi Jens and Brian. I don't know, if it fits here, but I found a little bug and also have a small suggestion:

-> You can rename the stage
-> New sprites should be undraggable by default

Thanks for mentiong these. Being able to rename the stage is a feature, not a but. You can rename the stage in Scratch, too. (I sometimes rename mine to "deep space" or "island" etc.)

Should new sprites be undraggable by default? That's a good question, because - you're right - most of the time I end up making mine undraggable. However, I also think it would be quite an impediment if you couldn't move them around as you first create them. What do you think?

I vote it should be like Scratch: always draggable in design mode but undraggable by default for presentation mode.


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

Offline

 

#5777 2012-08-15 09:03:35

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

Re: BYOB 3 - Discussion Thread

snap! question: Can I access a variable in the dynamic scope if it is also the name of a global variable?

snap! suggestion: a <(variable) is bound (drop-down: lexically/dynamically/at all)> block


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

 

#5778 2012-08-15 09:11:34

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

Re: BYOB 3 - Discussion Thread

Jens wrote:

You can rename the stage in Scratch, too.

No, you can't...


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

Offline

 

#5779 2012-08-15 09:24:27

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

Re: BYOB 3 - Discussion Thread

Why won't this work?


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

 

#5780 2012-08-15 09:38:27

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

Re: BYOB 3 - Discussion Thread

MathWizz wrote:

Jens wrote:

You can rename the stage in Scratch, too.

No, you can't...

Whoa! You're right, I never noticed... Well, anyway I strongly feel that you should be able to rename any object to anything, so, there you go. This is definitely a feature which I specifically implemented.


Jens Mönig

Offline

 

#5781 2012-08-15 10:02:27

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

Re: BYOB 3 - Discussion Thread

joefarebrother wrote:

snap! question: Can I access a variable in the dynamic scope if it is also the name of a global variable?

snap! suggestion: a <(variable) is bound (drop-down: lexically/dynamically/at all)> block

At this time hybrid scope doesn't exist, and you can only access the lexical scope. Personally, I think that's exactly the right thing to do, hybrid scope opens up a can of worms of kludges and collisions - as you have found out in your question. But Brian is lobbying hard to put dynamic scape back in, because he wants to use it for local helper functions. So, stay tuned!


Jens Mönig

Offline

 

#5782 2012-08-15 10:30:44

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

Re: BYOB 3 - Discussion Thread

Jens wrote:

joefarebrother wrote:

snap! question: Can I access a variable in the dynamic scope if it is also the name of a global variable?

snap! suggestion: a <(variable) is bound (drop-down: lexically/dynamically/at all)> block

At this time hybrid scope doesn't exist, and you can only access the lexical scope. Personally, I think that's exactly the right thing to do, hybrid scope opens up a can of worms of kludges and collisions - as you have found out in your question. But Brian is lobbying hard to put dynamic scape back in, because he wants to use it for local helper functions. So, stay tuned!

Oh well. I can still implement my project using lexical scope like this:

script variables (old value)
set [old value v] to (dynamic variable)
run (script)
set [dynamic variable v] to (old value)


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

 

#5783 2012-08-15 10:55:37

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

Re: BYOB 3 - Discussion Thread

joefarebrother wrote:

Oh well. I can still implement my project using lexical scope like this: (...)

Yes, that's exactly my point! You don't need hybrid scope.

Last edited by Jens (2012-08-15 10:55:51)


Jens Mönig

Offline

 

#5784 2012-08-15 11:10:31

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

Re: BYOB 3 - Discussion Thread

I LOATHE how Scratch handles direction, but its blocks are my only reference for recreating it in Canvas.
Shouldn't

Code:

if (opp<0)
{
    direction = 180+(r_to_d(Math.atan((opp/adj))));
}
else
{
    direction = (r_to_d(Math.atan((opp/adj))));
}    
        
scrollX = scrollX + (Math.sin(direction))*adj;
scrollY = scrollY + (Math.cos(direction))*opp;

work ok? (By the way, r_to_d is a function for radians to degrees)

Offline

 

#5785 2012-08-15 11:19:56

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

Re: BYOB 3 - Discussion Thread

shadow_7283 wrote:

I LOATHE how Scratch handles direction, but its blocks are my only reference for recreating it in Canvas.
Shouldn't

Code:

if (opp<0)
{
    direction = 180+(r_to_d(Math.atan((opp/adj))));
}
else
{
    direction = (r_to_d(Math.atan((opp/adj))));
}    
        
scrollX = scrollX + (Math.sin(direction))*adj;
scrollY = scrollY + (Math.cos(direction))*opp;

work ok? (By the way, r_to_d is a function for radians to degrees)

Think what would happen if adj was 0. You need atan2(opp, adj)


Again,

joefarebrother wrote:

Why won't this work?

Last edited by joefarebrother (2012-08-15 11:20:23)


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

 

#5786 2012-08-15 11:37:23

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

Re: BYOB 3 - Discussion Thread

shadow_7283 wrote:

I LOATHE how Scratch handles direction, but its blocks are my only reference for recreating it in Canvas.
Shouldn't

Code:

scrollX =+ (Math.sin(r_to_d(direction))) * speed;
scrollY =+ (Math.cos(r_to_d(direction))) * speed;

work ok? (By the way, r_to_d is a function for radians to degrees)

Fix'd. What is this for?


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

Offline

 

#5787 2012-08-15 11:48:33

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

Re: BYOB 3 - Discussion Thread

shadow_7283 wrote:

I LOATHE how Scratch handles direction

+1. Why'd they have to do that weird negative flip-flop?  hmm


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

Offline

 

#5788 2012-08-15 11:53:16

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

Re: BYOB 3 - Discussion Thread

MathWizz wrote:

shadow_7283 wrote:

I LOATHE how Scratch handles direction, but its blocks are my only reference for recreating it in Canvas.
Shouldn't

Code:

scrollX =+ (Math.sin(d_to_r(direction))) * speed;
scrollY =+ (Math.cos(d_to_r(direction))) * speed;

work ok? (By the way, r_to_d is a function for radians to degrees)

Fix'd. What is this for?

fix'd again


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

 

#5789 2012-08-15 12:02:13

BirdByte
Scratcher
Registered: 2012-07-07
Posts: 1000+

Re: BYOB 3 - Discussion Thread

shadow_7283 wrote:

I LOATHE how Scratch handles direction.

It is pretty awkward, but it's comprehensible.


http://i50.tinypic.com/312u714.jpg

Offline

 

#5790 2012-08-15 12:37:54

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

Re: BYOB 3 - Discussion Thread

joefarebrother wrote:

MathWizz wrote:

shadow_7283 wrote:

I LOATHE how Scratch handles direction, but its blocks are my only reference for recreating it in Canvas.
Shouldn't

Code:

scrollX =+ (Math.sin(d_to_r(direction))) * speed;
scrollY =+ (Math.cos(d_to_r(direction))) * speed;

work ok? (By the way, r_to_d is a function for radians to degrees)

Fix'd. What is this for?

fix'd again

Wow. I failed. xD

Is this becomming offtopic or what?


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

Offline

 

#5791 2012-08-15 12:42:42

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

Re: BYOB 3 - Discussion Thread

yeah... lets get back on topic.


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

 

#5792 2012-08-15 13:02:42

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

Re: BYOB 3 - Discussion Thread

Thanks for the help guys.  smile
I don't know what it is, but Chrome's interpreter never lets me use =+ .
EDIT: Look at this weird behavior... (right click)

Last edited by shadow_7283 (2012-08-15 13:18:54)

Offline

 

#5793 2012-08-15 13:10:49

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

Re: BYOB 3 - Discussion Thread

isn't it += ?


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

 

#5794 2012-08-15 13:15:38

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

Re: BYOB 3 - Discussion Thread

joefarebrother wrote:

isn't it += ?

Just citing your fixes.  wink

Offline

 

#5795 2012-08-15 13:25:19

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

Re: BYOB 3 - Discussion Thread

joefarebrother wrote:

isn't it += ?

Yes, yes it is.  hmm


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

Offline

 

#5796 2012-08-15 17:22:59

dasbloekendeschaf
Scratcher
Registered: 2010-10-01
Posts: 100+

Re: BYOB 3 - Discussion Thread

Hardmath123 wrote:

Jens wrote:

dasbloekendeschaf wrote:

Hi Jens and Brian. I don't know, if it fits here, but I found a little bug and also have a small suggestion:

-> You can rename the stage
-> New sprites should be undraggable by default

Thanks for mentiong these. Being able to rename the stage is a feature, not a but. You can rename the stage in Scratch, too. (I sometimes rename mine to "deep space" or "island" etc.)

Should new sprites be undraggable by default? That's a good question, because - you're right - most of the time I end up making mine undraggable. However, I also think it would be quite an impediment if you couldn't move them around as you first create them. What do you think?

I vote it should be like Scratch: always draggable in design mode but undraggable by default for presentation mode.

Agree.

PS1: If the stage should be renamable, I have a little improvement idea: I renamed it into "Scratch", opened another sprite and then returned to the stage. The name went to the default one. It's because I didn't press enter before going to and editing the sprite. I mean, many people will forget to press it and then think it's a bug. (BTW: Renaming a sprite in Scratch 1.4 is like in my suggestion)

PS2: Why did you change the button graphics of the sprite rotation options? It doesn't look that clearly anymore as it did in Scratch 1.4 or an earlier alpha of snap.


http://simpliciter.bplaced.net/templates/business4/images/logo.png

Offline

 

#5797 2012-08-15 21:53:52

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

Re: BYOB 3 - Discussion Thread

joefarebrother wrote:

Why won't this work?

Sorry for the delay; I started trying to answer this while teaching teachers at the same time but couldn't quite manage.

A continuation isn't a subroutine -- it never returns to its caller.  Continuations, even continuations of reporters, are always commands; you RUN them, not CALL them.  The continuation of a reporter takes an input, and returns from that reporter with the given value.

Here's my version that doesn't work either.  I'm dead tired but I'll look into it when I wake up.  Or maybe Jens will debug it.  smile


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

Offline

 

#5798 2012-08-15 22:14:28

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

Re: BYOB 3 - Discussion Thread

joefarebrother wrote:

Oh well. I can still implement my project using lexical scope like this:

script variables (old value)
set [old value v] to (dynamic variable)
run (script)
set [dynamic variable v] to (old value)

This technique (called FLUID-LET in the literature) works only if the variable is globally bound.  The whole point of local variables (well, okay, part of the point) is to keep from having to clutter up your global environment with temporarily-useful variables.

There are many successful languages that are lexically scoped, and many that are dynamically scoped.  (These days the ones you've heard of are lexically scoped, because that makes compiler optimization easier.)  The thing that I want to do, conceptually a little more complicated, is to allow the two scoping disciplines to coexist.  My proposal ("hybrid scope") is that, to avoid name capture bugs, the lexical environment -- which includes global bindings -- wins.  Snap! should be lexically scoped, except just when we're about to give a "no such variable" error message, we instead look in the dynamic environment.  Because we don't look there except for what would otherwise have been an error, it won't slow down lexically scoped programs, and it will allow the use of unique names with dynamic scope.  Best of both worlds.


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

Offline

 

#5799 2012-08-15 22:21:53

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

Re: BYOB 3 - Discussion Thread

shadow_7283 wrote:

I LOATHE how Scratch handles direction

Do you mean clockwise-from-North rather than counterclockwise-from-East?

CW-f-N is the standard for people who use maps of Earth: surveyors, orienteers, navigators, etc.  I believe, but I'm too tired to double check right now, that this standard way predates Descartes.

CCW-f-E is, of course, what mathematicians use on the XY (or complex) plane.  The trig functions are defined in terms of CCW-f-E.

Scratch and its children inherit CW-f-N from Logo, whose designers decided that little kids (think third grade) are more likely to have read maps than to have studied analytic geometry.


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

Offline

 

#5800 2012-08-16 03:06:56

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

Re: BYOB 3 - Discussion Thread

snap! wrote:

Save Failed: Type Error: Object doStop has no method 'toXML'

Why? It saved before and i only changed one block. (I changed a call to a run)


Also, it is REALLY slow opening projects with a URL-embedded XML file.

Last edited by joefarebrother (2012-08-16 03:40:26)


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

 

Board footer