Skip to content

Commit

Permalink
make sure acc_round returns integers
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco149 committed Aug 18, 2017
1 parent 87fa65b commit 6fd2d3c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyttanko.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
'''

__author__ = "Franc[e]sco <[email protected]>"
__version__ = "1.0.9"
__version__ = "1.0.10"

import sys
import math
Expand Down Expand Up @@ -961,6 +961,8 @@ def acc_round(acc_percent, nobjects, misses):
((acc_percent * 0.01 - 1.0) * nobjects + misses) * 0.5
)

n100 = int(n100)

if n100 > nobjects - misses:
# acc lower than all 100s, use 50s
n100 = 0
Expand All @@ -971,6 +973,7 @@ def acc_round(acc_percent, nobjects, misses):
) * 0.5
)

n50 = int(n50)
n50 = min(max300, n50)

else:
Expand Down

0 comments on commit 6fd2d3c

Please sign in to comment.