On this topic you may post the formulas may use in scratch to calculate formulas. I have two examples that are sure to work.
Is it Bumpy is it Round?
Using this formula you can tell if a number has a fraction in it, or if it doesnt:
if <(variable)=round (variable)>
Pretty simple but some people may have not known.
The Opposite Number
With four variables (the min, max, original number, and the new number), you can find the opposite. Lets say the min is 0, and the max is 100. With this 50 would be 50, 25 would be 75,10 would be 90, and 100 would be 0.Here it is, and remember it doesn't matter if it is negative or not with any of the variables:
Set new number to ( (-1 * original number) + (min + max) )
If you don't get the pattern look at it like this:
There is a number line.
<------------------------------------------------------->
0 50 100
Now you put a dot on it in a random place like 35 for example.
<-----------------o------------------------------------>
0 50 100
Now flip the number line.
<-----------------o------------------------------------>
100 50 0
And now based on the numbers its about 65. You could also do -40 be the min, and 50 being the max and do that. So 5 would be 5, 30 would be -20 and ext.
Hope this helps (and gets stickied, but how does a topic get stickied?????).
Offline
A topic gets sticked when a moderator stickes it (at least I'm assuming that).
Offline
thecooltodd wrote:
A topic gets sticked when a moderator stickes it (at least I'm assuming that).
Oh, well that sounds reasonable.
Offline
Ok, I have a new formula. It might help.
Fraction to Percentage
So you have the numberater and the denomonator. Here is the formula:
/ \
| (100 divided by denomonator) x numerator |
\ /
And how would this be used you ask? Well in a game it keeps track of your wins and loses. You want to find the win percentage. So you would do this:
/ \
| / \ |
| | 100 divided by ( Wins + Loses ) | x Wins |
| \ / |
\ /
Easy huh? Thanks.
Last edited by Lucario621 (2008-05-04 11:39:20)
Offline
I have one. Custom Score, health, etc display
Ones digit is easy. Just do this:
[blocks]<when green flag clicked>[/blocks]
[blocks]<forever>[/blocks]
[blocks]<switch to costume[ <{ health }>[/blocks]
This is for the tens, hundreds, thousands, etc digits. Just replace the ten with a different power of ten:
[blocks]<when green flag clicked>[/blocks]
[blocks]<forever>[/blocks]
[blocks]<switch to costume[(( ((<{ health }> </>10 )) <-> .5 ))[/blocks]
Last edited by Bluestribute (2008-05-09 23:58:36)

Offline