Open miselico opened 4 years ago
Fairly sure that this is because python indices start at 0. Using the default values, you would then go from 0 -> 1999 inclusive, leading to 2000 iterations.
If you didn’t set the upper limit at games-1, you would do 1 more iteration than intended.
Yes, but range is exclusive. So range(5)
give you [0,1,2,3,4]
This is related to this commit, when the change to range(games-1)
happened. I'd guess it was done to prevent some wonky behavior with the progress bar, which was added in the same commit, although now it looks like using range(1, games+1)
produces the expected behavior with the correct number of games:
In train-ml-bot, there is a line
for g in range(games-1):
. It is unclear to me why the-1
is there. I think it should be removed.