Closed cai-lw closed 3 years ago
Thanks for pointing this out, cai-lw! I fixed the comment to reflect what the line of code says (lengthening it from 50 to 200 was a last-minute change I made, oops) And I went with the 1-random.random() approach. cool cool
The code contradicts with the comment
https://github.com/carykh/PrisonersDilemmaTournament/blob/2a4b657365618bb443127157622ca81350c97805/code/prisonersDilemma.py#L44
BTW, a nit:
random.random()
can return 0 (although very unlikely) and crash the program. Consider using1 - random.random()
as that will never be zero (See https://docs.python.org/3/library/random.html#random.random)