PD-Home · Introduction · PDS-Instructions · PDS-Examples · PDS-Exercises · Tournament-Entries |
( and how to program them in PDS )
; Always defect
|
; Always cooperate
|
; Cooperate 15% of the time
|
; Do the opposite of what your partner just rest: |
; Do the opposite of what ; Here, we count the number of Coops ; Here, we decide what to do |
; Coop on the first move, Rest:
|
; Try to detect whether your partner is "special": ; Play randomly for the first 5 moves. ; Then figure out whether your partner started ; her strategy with the 5-move sequence: ; coop,coop,defect,defect,coop ; If so, then she's "special" ; and cooperate with her after 5 moves, ; otherwise defect always if num-moves >= 5 goto Detect-Special report random 50 Detect-Special: set nthmove num-moves ; check if first move is coop if move-other nthmove != coop goto Not-Special ; check if second move is coop set nthmove nthmove - 1 if move-other nthmove != coop goto Not-Special ; check if third move is defect set nthmove nthmove - 1 if move-other nthmove != defect goto Not-Special ; check if fourth move is defect set nthmove nthmove - 1 if move-other nthmove != defect goto Not-Special ; check if fifth move is coop set nthmove nthmove - 1 if move-other nthmove != coop goto Not-Special ; OK, she's "special", cooperate report coop Not-Special: report defect |
; Play randomly for the first 3 moves, ; then Defect if your partner defected more often ; than she cooperated, ; otherwise Cooperate if num-moves >= 3 goto Majority-Calculation Majority-Calculation: if She-defected > She-cooped goto Revenge Revenge:
|