Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Number of games for ML bot #3

Open
miselico opened this issue Jun 18, 2020 · 3 comments
Open

Number of games for ML bot #3

miselico opened this issue Jun 18, 2020 · 3 comments

Comments

@miselico
Copy link

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.

@jc0b
Copy link

jc0b commented Jun 18, 2020

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.

@miselico
Copy link
Author

Yes, but range is exclusive. So range(5) give you [0,1,2,3,4]

@ursulean
Copy link

ursulean commented Jun 19, 2020

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:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants