Well, I am making an OS and it has a calculator application. I have two sprites for the answer and they switch to a certain costume depending on the answer. The problem is that I have tried to make the ones digit change to a certain costume based on the ones value. eg answer 81 sprite of ones 1. My formula was
set answer ones to round answer/10 -.5
this doesn't work because scratch round things to the nearnest tenth so what I am trying to do doesn't work. Any suggestions?
Offline
if answer over 10 is less than 1 set costume of sprite1 to costume10 and costume of sprite2 to answer. costume 10 will be zero and all other costumes will be the same as their number.if not, do the following if answer over 10 rounded is less than answer over 10, set sprite1 costume to answer/10 rounded. if answer over 10 rounded is greater than answer over 10 set sprite1 costume to answer over 10 rounded -1.if answer-10x the costume number of sprite1=0, switch to costume 10. if not, do the following: set sprite2 costume to answer minus 10 times costume number of sprite 1.
Offline
Try using the MOD function from the numbers area. It returns the remainder of a division. For example:
81 MOD 10 = 1
97 MOD 10 = 7
Offline