Help! I've been working on a project for a while but I didn't want to use the variables that scratch has. So I calculated the percentage (for the project) and made four sets of three digits (sprites) so I could display the numbers from the variables. So far sometimes the sprites are accurate, other times they're off by 10% or 1% sometimes others. Any ideas on how to fix this would definitely be appreciated. Heres an example of what I tried: (the variable "one" is the number I want to display)
Tens place: (usually the one that messes up)
<switch to costume[(( (( <{ 1 }> <mod>100 )) / 10 ))
Hundreds place:(normally accurate)
(if)
<if><( (( <{ 1 }> </> 1 )) <=> 100 )>
<switch to costume[ 9 (the digit one)
<else>
<switch to costume[ 10 (the digit zero)
Ones place: (another normal mess up)
<switch to costume[ (( <{ 1 }> <mod> 10 ))
Note: I'm also placing this on all about scratch.
Offline
I just went through that excercise myself. Here is what I came up with:
http://scratch.mit.edu/projects/Paddle2SeeFixIt/156911
There's a really simple technique I also saw that didn't use Mod at all...it just took advantange of the fact that the costumes would wrap around if you indexed beyond the top costume. But the method I did used Mod...along with the Round function.
Offline
Paddle2See wrote:
I just went through that excercise myself. Here is what I came up with:
http://scratch.mit.edu/projects/Paddle2SeeFixIt/156911
There's a really simple technique I also saw that didn't use Mod at all...it just took advantange of the fact that the costumes would wrap around if you indexed beyond the top costume. But the method I did used Mod...along with the Round function.
Do you learn that from me????

Offline
Paddle2See wrote:
I just went through that excercise myself. Here is what I came up with:
http://scratch.mit.edu/projects/Paddle2SeeFixIt/156911
There's a really simple technique I also saw that didn't use Mod at all...it just took advantage of the fact that the costumes would wrap around if you indexed beyond the top costume. But the method I did used Mod...along with the Round function.
Thanks a bunch for that method, you may see my survey project soon on the website. Thanks again!
Offline