Follow-up Comment #3, bug #15563 (project freeciv):

> and use index = chance / 14. This will result in the following indices: 

Another way to go:

use index = 0 only for chance = 0% to indicate that there is no pollution at
all

index 1 to 6 would be equally splitted to the interval ]0-(100) using index 7
for the leftover percentages at the end. This results in:

for =0: index 0
for >0% to <15%: index 1
for 15% to <30%: index 2
...
for 75% to <90%: index 6
for >=90%: index 7

or within the code

index = (chance == 0) ? 0 : (chance / 15) + 1


    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?15563>

_______________________________________________
  Nachricht geschickt von/durch Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to