I've uploaded a file which works fine on my laptop, but does not run all scripts after being loaded into the gallery. Is there some problem with converting the file for display in the gallery?
The problem is related to the "distance to" block. Perhaps there is a round-off error? Or perhaps it's some borderline programming that craps out when being converted?
If it helps, the file is ...
http://scratch.mit.edu/projects/jaxonwhite/42853
any insight is appreciated.
thx
Offline
I think that the problem is that you did an EQUALITY test on distance.
Try changing your test from (distance=2) to (distance < 2).
Because the distance is a floating point number, it may never exactly equal 2.
Offline
kevin is right and by the way, the problem you're experiencing is not related to the fact that the project was added to a gallery
Offline
thx, people. changing the operator created much more robust performance. still wondering why it worked on the laptop, but not after loading into the gallery. perhaps a difference in the display mode?
Offline
There may be a rounding operation that happens in the squeak implementation and not the java implementation, or they may use slightly different floating-point implementations that resulted in one being ending up equal to 2 and the other at 2.000001
The vagaries of floating-point math are why you should never do equality checks on floating-point numbers.
Offline