Anonymous user
Rock-paper-scissors: Difference between revisions
m
Changed "Successors" to "Successor".
m (Changed "Successors" to "Successor".) |
|||
Line 3,533:
History = tuple[total: int; counts: CountTable[Choice]]
const
func `>`(a, b: Choice): bool =
## By construction, only the successor is greater than the choice.
a ==
proc choose(history: History): Choice =
Line 3,545:
for choice, count in history.counts.pairs:
if value <= count:
return
dec value, count
|