Depending on how much time is allowed the following might be a viable solution: with a 1% chance cooperate, otherwise run the other bot’s source code. If the bot plays itself, or for that matter any other bot that tries to run its source code, after 100 (on average) iterations it will return cooperate, and then working backwards will (usually) converge to the right thing.
Obviously, the value of 1% should be as small as possible; the average time used is proportional to the reciprocal of the probability.
Depending on how much time is allowed the following might be a viable solution: with a 1% chance cooperate, otherwise run the other bot’s source code. If the bot plays itself, or for that matter any other bot that tries to run its source code, after 100 (on average) iterations it will return cooperate, and then working backwards will (usually) converge to the right thing.
Obviously, the value of 1% should be as small as possible; the average time used is proportional to the reciprocal of the probability.