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

#1 2007-06-22 16:14:38

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

v13 bug?

It seems that the v13 java player has broken my Simon game

http://scratch.mit.edu/projects/kevin_karplus/2158

(Thanks, jsimone, for pointing this out)

What changed between v12 and v13 besides the broadcast loop bug fix?

The most likely change to cause problems is something that changes the "touching color" tests, as Simon relies heavily on sensing colors.

Offline

 

#2 2007-06-23 09:35:30

johnm
Scratcher
Registered: 2007-03-08
Posts: 100+

Re: v13 bug?

Hi, Kevin.

Sorry that the change broke Simon! I only changed the one thing, but one effect is that if you do two broadcasts (not "broadcast and wait") in a row, the triggered scripts are now run in the reverse order. If the second one depended on the first having been run, it may no longer work. One fix is to make the first broadcast into a "broadcast and wait".

This is the second project I've heard about that was broken by the recent change. I'm thinking that it may be better to revert to the old ordering for the sake of other projects that may have been depending on it. What do you think?

  -- John

Offline

 

#3 2007-06-23 10:41:53

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: v13 bug?

If the problem is relying on an ordering of broadcasts being received (not broadcast and wait), then it is a bug in the user program, not in scratch. A subtle one, but a user programming error.

If there is a broadcast, followed by a broadcast-and-wait, then you *can't* swap the orders, at least, you can't do the wait before both broadcasts are sent.

I can fix Simon by using two broadcast-and-wait calls, and the bug is indeed mine for relying on a race condition---expecting a broadcast to have been received and acted on without actually waiting for it.

Offline

 

Board footer