arundelo comments on Prisoner's Dilemma (with visible source code) Tournament - Less Wrong

47 Post author: AlexMennen 07 June 2013 08:30AM

You are viewing a comment permalink. View the original post to see all comments and the full post content.

Comments (232)

You are viewing a single comment's thread. Show more comments above.

Comment author: Lumifer 05 June 2013 09:12:15PM *  0 points [-]

Hm. Five minutes of thought suggest to me that the following pseudocode would be optimal:

while(passed.time < 9.5seconds) {
outcome = eval(opponent.code(self.code))
if (outcome == "C") { c.count++ }
if (outcome == "D") { d.count++ }
}
if (c.count > d.count) {
output("C")
} else {
output("D")
}

Deterministic programs would always output the same thing so you know beforehand whether they'll cooperate or defect. For RNG-based programs you just bet on what's most likely.

I welcome big guns blowing large holes in this construction :-)

P.S. How do I indent in preformatted code?

Comment author: arundelo 06 June 2013 01:51:05AM 1 point [-]

The indentation thing is a bug.