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 advanced topics.
Offline
I did this for mine kinda:
[blocks]<when green flag clicked>[/blocks]
[blocks]<forever>[/blocks]
<switch to costume[ <{ score }>[/blocks]
And for tens, you use it also for hundreds, just didvde by that much and add when it shows:
[blocks]<when green flag clicked>[/blocks]
[blocks]<forever>[blocks]
[blocks]<switch to costume[ (((( <{score }> </>10 )) <-> .5 ))[/blocks]
Offline
coolstuff wrote:
AURGH! I didn't know you could do (switch to costume) then a variable! THANKS! THAT MAKES MY LIFE SO MUCH EASIER! WOW!!!
OMG YOUR THE BEST SCRATCHER EVER!
ME? Your welcome??? Shadow? He's welcome
Offline