Morendil 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: itaibn0 06 June 2013 12:36:01PM *  1 point [-]

Using ThrustVectoring's idea, I have a template other people can use to make a clique-team. The following code

(let ((time (current-inexact-milliseconds))
(template '(let ((time (current-inexact-milliseconds))
(template '2))
(lambda (opponent)
(if (let pattern-match ((pattern template)
(value opponent))
(cond
((pair? pattern) (and (pair? value)
(pattern-match (car pattern) (car value))
(pattern-match (cdr pattern) (cdr value))))
((number? pattern) (case (+ pattern 1)
((1) #t)
((3) (equal? value template))
(else (and (number? value)
(= pattern value)))))
(#t (eq? pattern value))))
'C
0)))))
(lambda (opponent)
(if (let pattern-match ((pattern template)
(value opponent))
(cond
((pair? pattern) (and (pair? value)
(pattern-match (car pattern) (car value))
(pattern-match (cdr pattern) (cdr value))))
((number? pattern) (case (+ pattern 1)
((1) #t)
((3) (equal? value template))
(else (and (number? value)
(= pattern value)))))
(#t (eq? pattern value))))
'C
(if (= (* 369 271) 99999)
'D
'C))))

Tests weather the opponent code is based on the same pattern, and if so, cooperates. Otherwise it verifies an arithmetical fact and then defects.

ETA: Sorry, I was writing this in a hurry. To clarify, the idea was to create a Schelling point for a specific AbsoutismBot wrapper which will help all of the submitters to cooperate. Unfortunately, this current program doesn't work (and the indentation doesn't work either). I will try to modify it in the future.

ETA: Boy, the original is so bug-ridden it's funny. Anyways, I tested this and it should work. Use this for Schelling point needs.

ETA: Bah, I give up in trying to get it indented properly.

ETA: AlexMennen has clarified the rules so that my meta-strategy is illegal.

Comment author: Morendil 08 June 2013 08:19:11AM 0 points [-]

The timing clause in the initial let is superfluous. Time doesn't enter into the matching, which is really all that the template needs; if you need timings to deal with non-CliqueBot players differently, you can get them in the "do something else" section.

Comment author: itaibn0 08 June 2013 11:11:43PM 0 points [-]

The idea behind the timing clause is so that the program will know precisely when it started running, rather than when the pattern-matching was completed. Now, I did this test:

> (define func (eval code0))
> (time (func code0))
cpu time: 0 real time: 1 gc time: 0
'C

which reveals that the difference isn't significant. However, now that the code is out in the open, I'm not changing it.