off-by-one error

This commit is contained in:
Joseph Montanaro 2021-07-14 08:43:12 -07:00
parent bd413da9a3
commit 57c991cf5f

View File

@ -105,7 +105,7 @@ proc randomGames*(b: Board, count: Natural, parallel = true, numThreads = 0): Sc
var workers = newSeq[Thread[WorkerArgs]](numThreads)
for i, w in workers.mpairs:
var numGames = int(floor(count / numThreads))
if i <= (count mod numThreads):
if i < (count mod numThreads):
numGames += 1
let args = WorkerArgs(board: b, count: numGames, seed: rand(int64))