So I have a range of numbers for this example I would say something like 0 to 25. Within this range if I get a number lets say 11, then for each number that between my goal I it weighs more depending on the range.
So in this case of the range being 0 to 25, and I have the number 11 and I am trying to point it out, but instead I point out 13 this would mean the weight of the number = 2.
Now what I would like to achieve is to have a modifier that modifies the weight according to number.
So as example that if you have 0 to 50, and you number was 11, and you chose 16 that the weight would also be 2.
I am usually pretty okay with basic mathematics, but I don't know what category this is in since I have no clue on where to start.
UPDATE: the chose number can also be lower then the given number. Each distance will still add weight, depending on range.