off-by-one error
This commit is contained in:
parent
bd413da9a3
commit
57c991cf5f
@ -105,7 +105,7 @@ proc randomGames*(b: Board, count: Natural, parallel = true, numThreads = 0): Sc
|
|||||||
var workers = newSeq[Thread[WorkerArgs]](numThreads)
|
var workers = newSeq[Thread[WorkerArgs]](numThreads)
|
||||||
for i, w in workers.mpairs:
|
for i, w in workers.mpairs:
|
||||||
var numGames = int(floor(count / numThreads))
|
var numGames = int(floor(count / numThreads))
|
||||||
if i <= (count mod numThreads):
|
if i < (count mod numThreads):
|
||||||
numGames += 1
|
numGames += 1
|
||||||
let args = WorkerArgs(board: b, count: numGames, seed: rand(int64))
|
let args = WorkerArgs(board: b, count: numGames, seed: rand(int64))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user