I'm running an iterated prisoner's dilemma tournament where all programs are restricted to 240 characters maximum. The exact rules are posted in the Manifold Markets link; I figured I'd cross-post the contest here to reach more potentially-interested people.
You don't need a Manifold account to participate, you can just put your program in the comments on LessWrong or PM me. If you win, I'll donate your winnings to the charity of your choice.
The tournament allows you to enter 3 bots, so we should be able to cheat if our bots can recognize each other. If so we have 1 bot, "ringer", and 2 bots "shill0" and "shill1" and follow this strategy:
ringer: if my opponent is shill0 or shill1, always defect. otherwise, play tit-for-tat.
shill0: if my opponent is ringer, always cooperate. otherwise play tit-for-tat.
To recognize each other, since we have access to the source code of both bots during the game, we need a hash function which is efficient in terms of characters used. One possibility would be to simply count the character codes. So we have
This expression takes 41 chars, so we should be able to fit that in along with the required logic.
The obvious difficulty is that somebody could attempt to piggyback: craft a bot whose hash adds up to the same as the one our shills will auto-cooperate with. However, we should be able to solve this:
shill: if
hash(c+s) = N
, always cooperate. otherwise, play tit-for-tatringer: if
hash(c+s) = M
always defect. otherwise, play tit-for-tatwhere c is the source code of the opponent and s is the source code of ourself.
We note that the rules of the challenge permit us to submit one of our bots by private message so that other players cannot see it. Therefore, we submit the source of ringer privately, and nobody should be able to piggyback.
Well, I'd encourage you to submit this strategy and see how it does. :)