One of my students wrote the project "bug". It seems to work fine when I download it and run it in Scratch, but it doesn't function at all on the uploaded version on the web site. Has he found a bug in the Java player?
Offline
There are many bugs in the Java player.
The most frequent problem seems to be from not including a wait statement in every forever loop. The java player is much more susceptible to the scheduling problems that this programming error can cause. I don't see any differences in behavior for this program between the java and the squeak implementations---what is the problem? Of course, there are forever-loops without waits in this program (each robot), so the behavior may well be different on different speed machines or different java virtual machines. Put a wait 0.05 seconds in each forever loop and the behavior will be more consistent.
There are also differences between the Java player and the squeak implementation due to bugs in the Squeak implementation (like the off by (-1,1) error for the pen).
It is useful to try to isolate the problem, so the scratch team can determine whether it is a known bug (and hence likely to be fixed in the next release) or a new one that they need to track down.
I suspect that they'll have a new release pretty soon, as there were a lot of minor bug reports in the past couple of weeks.
Last edited by kevin_karplus (2007-06-07 13:14:42)
Offline
The bug in "bug" is that on the web site, the robots often don't move when the green flag is clicked. On second glance, other sprites seem to be operating, so maybe he has some initialization problems. I'll have to take a closer look at his code.
Offline
The robots worked when I tried on the web site, so I think the problem is machine-dependent.
Putting waits in the forever loops will probably fix it.
Offline
I tried a few things, and just putting short waits in all the forever loops didn't seem to fix it. However, doing that plus cleaning up a few other things like taking out some redundant "if on edge bounce" blocks seemed to fix things up.
If it worked for Kevin before, perhaps it's a glitch in the version of Java on our local machines. Seems less like a Scratch bug, though.
Offline