To be honest, I feel like it's weird that in the scheme of things the middle doesn't matter.
Take this ludicrous example:
50, 78, 80
50, 52, 80
Game gets a 79, both people get the same points.
Now you might be thinking, that doesn't matter!
Or you might be thinking, "how can I fix this?"
And boy do I have the solution for you.
(100-(high-low)) /
abs(actual - mid) + 1
This has the benefit, that if you get the score exactly on:
high=low = mid=actual, you get 100 points.
Really big ranges will give you a smaller score, and the closer your mid is to the actual will give you a bigger score.
If you don't want decimals, just take the floor!
Take this ludicrous example:
50, 78, 80
50, 52, 80
Game gets a 79, both people get the same points.
Now you might be thinking, that doesn't matter!
Or you might be thinking, "how can I fix this?"
And boy do I have the solution for you.
(100-(high-low)) /
abs(actual - mid) + 1
This has the benefit, that if you get the score exactly on:
high=low = mid=actual, you get 100 points.
Really big ranges will give you a smaller score, and the closer your mid is to the actual will give you a bigger score.
If you don't want decimals, just take the floor!