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

#1 2009-11-28 22:11:08

scmb1
Scratch Team
Registered: 2009-03-19
Posts: 1000+

I may have found a bug

While making a fractal project, I wanted to make a script repeat 3^ iteration times. To make the exponent, I used log. Offline, the script repeated one more time than I wanted. To solve this I subtracted 1 from the repeat number. However, online the script repeated 1 less time than I wanted, only working properly when I added 1. I worked this out by asking users to change the number upon download, so it now work both on and offline.

While I finally made my project work, I think this is a bug. I'm not sure whether the bug is in the repeat block, the log block, or something else. I do not need help with the project. I just wanted to let you know about this bug. Here is the project http://scratch.mit.edu/projects/scmb1/779074

Thanks!


http://i48.tinypic.com/2z5pqad.png

Offline

 

#2 2009-11-29 06:48:30

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: I may have found a bug

There might be some slight differences in the results of the functions online versus offline.  Possibly using the Round function to force it to return an integer will cure the problem?


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#3 2009-11-29 06:53:50

filo5
Scratcher
Registered: 2008-01-08
Posts: 1000+

Re: I may have found a bug

Solution: Include my offline mode detector.


Converting my Scratch projects to Python!

Offline

 

#4 2009-11-29 12:30:05

scmb1
Scratch Team
Registered: 2009-03-19
Posts: 1000+

Re: I may have found a bug

Paddle2See wrote:

There might be some slight differences in the results of the functions online versus offline.  Possibly using the Round function to force it to return an integer will cure the problem?

Ah ha! Thank you very much. Perhaps it should be made more public that when you use functions in a repeat block you need to round it. I suppose this should have been obvious, since it can't repeat part of a time, but I didn't think of it since my equation always made a whole number. It's still kind of strange that it's different online and offline. Thank you Paddle2See.


http://i48.tinypic.com/2z5pqad.png

Offline

 

Board footer