So I'm doing some programming, and to simplify a very large amount of if statements, I've decided to put it down to a few lines with a simple equation, I've done this before with other things, but it was very much trial and error.
Therefore I'd like to see how it can be done in a more...