-
Notifications
You must be signed in to change notification settings - Fork 5
/
tournament.txt
278 lines (232 loc) · 12.4 KB
/
tournament.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
--------------------------------------------------------------------------------
Section 0 - Line up
--------------------------------------------------------------------------------
Player 0 (P0): E0, Collude
Always collude.
Player 1 (P1): E1, Betray
Always betray.
Player 2 (P2): E2, Alternate
Collude, then alternate.
Player 3 (P3): E3, Collude but retaliate
Collude first round. Collude, except in a round after getting
a severe punishment.
--------------------------------------------------------------------------------
Section 1 - Player vs. Player
--------------------------------------------------------------------------------
Each column shows pts/round earned against each other player:
P0 P1 P2 P3
vs. P0 : 0 100 49 0
vs. P1 : -500 0 -375 -376
vs. P2 : -249 -75 0 -199
vs. P3 : 0 -74 -199 0
TOTAL : -749 -49 -525 -575
--------------------------------------------------------------------------------
Section 2 - Leaderboard
--------------------------------------------------------------------------------
Average points per round:
Team name (P#): Score with strategy name
E1 (P1): -13 points with Betray
E2 (P2): -132 points with Alternate
E3 (P3): -144 points with Collude but retaliate
E0 (P0): -188 points with Collude
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
example0--------------------------------------------------------------------------------
####
# Each team's file must define four tokens:
# team_name: a string
# strategy_name: a string
# strategy_description: a string
# move: A function that returns 'c' or 'b'
####
team_name = 'E0'
strategy_name = 'Collude'
strategy_description = 'Always collude.'
def move(my_history, their_history, my_score, their_score):
'''Make my move based on the history with this player.
history: a string with one letter (c or b) per round that has been played with this opponent.
their_history: a string of the same length as history, possibly empty.
The first round between these two players is my_history[0] and their_history[0]
The most recent round is my_history[-1] and their_history[-1]
Returns 'c' or 'b' for collude or betray.
'''
# This player always colludes.
return 'c'
--------------------------------------------------------------------------------
example1--------------------------------------------------------------------------------
####
# Each team's file must define four tokens:
# team_name: a string
# strategy_name: a string
# strategy_description: a string
# move: A function that returns 'c' or 'b'
####
team_name = 'E1'
strategy_name = 'Betray'
strategy_description = 'Always betray.'
def move(my_history, their_history, my_score, their_score):
'''Make my move based on the history with this player.
history: a string with one letter (c or b) per round that has been played with this opponent.
their_history: a string of the same length as history, possibly empty.
The first round between these two players is my_history[0] and their_history[0]
The most recent round is my_history[-1] and their_history[-1]
Returns 'c' or 'b' for collude or betray.
'''
#This example player always betrays.
return 'b'
--------------------------------------------------------------------------------
example2--------------------------------------------------------------------------------
####
# Each team's file must define four tokens:
# team_name: a string
# strategy_name: a string
# strategy_description: a string
# move: A function that returns 'c' or 'b'
####
team_name = 'E2'
strategy_name = 'Alternate'
strategy_description = 'Collude, then alternate.'
def move(my_history, their_history, my_score, their_score):
'''Make my move based on the history with this player.
history: a string with one letter (c or b) per round that has been played with this opponent.
their_history: a string of the same length as history, possibly empty.
The first round between these two players is my_history[0] and their_history[0]
The most recent round is my_history[-1] and their_history[-1]
Returns 'c' or 'b' for collude or betray.
'''
# This player colludes on even numbered rounds (first round is round #0).
if len(my_history)%2 == 0:
return 'c'
else:
return 'b'
--------------------------------------------------------------------------------
example3--------------------------------------------------------------------------------
####
# Each team's file must define four tokens:
# team_name: a string
# strategy_name: a string
# strategy_description: a string
# move: A function that returns 'c' or 'b'
####
team_name = 'E3'
strategy_name = 'Collude but retaliate'
strategy_description = '''\
Collude first round. Collude, except in a round after getting
a severe punishment.'''
def move(my_history, their_history, my_score, their_score):
'''Make my move based on the history with this player.
history: a string with one letter (c or b) per round that has been played with this opponent.
their_history: a string of the same length as history, possibly empty.
The first round between these two players is my_history[0] and their_history[0]
The most recent round is my_history[-1] and their_history[-1]
Returns 'c' or 'b' for collude or betray.
'''
if len(my_history)==0: # It's the first round; collude.
return 'c'
elif my_history[-1]=='c' and their_history[-1]=='b':
return 'b' # Betray if they were severely punished last time,
else:
return 'c' # otherwise collude.--------------------------------------------------------------------------------
Section 3 - Game Data for Team E0
--------------------------------------------------------------------------------
-500 pt/round: E0(P0) "Collude"
100 pt/round: E1(P1) "Betray"
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
ccccccccccccccccccccccccccccccccc
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
--------------------------------------------------------------------------------
-249 pt/round: E0(P0) "Collude"
49 pt/round: E2(P2) "Alternate"
CcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCc
CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB
CcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcC
CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC
--------------------------------------------------------------------------------
0 pt/round: E0(P0) "Collude"
0 pt/round: E3(P3) "Collude but retaliate"
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Section 3 - Game Data for Team E1
--------------------------------------------------------------------------------
100 pt/round: E1(P1) "Betray"
-500 pt/round: E0(P0) "Collude"
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
ccccccccccccccccccccccccccccccccc
--------------------------------------------------------------------------------
-75 pt/round: E1(P1) "Betray"
-375 pt/round: E2(P2) "Alternate"
BbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBb
cbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcb
BbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBb
cbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcb
--------------------------------------------------------------------------------
-74 pt/round: E1(P1) "Betray"
-376 pt/round: E3(P3) "Collude but retaliate"
BbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBb
cbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcb
BbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbB
cbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbc
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Section 3 - Game Data for Team E2
--------------------------------------------------------------------------------
49 pt/round: E2(P2) "Alternate"
-249 pt/round: E0(P0) "Collude"
CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB
CcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCc
CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC
CcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcCcC
--------------------------------------------------------------------------------
-375 pt/round: E2(P2) "Alternate"
-75 pt/round: E1(P1) "Betray"
cbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcb
BbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBb
cbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcb
BbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBb
--------------------------------------------------------------------------------
-199 pt/round: E2(P2) "Alternate"
-199 pt/round: E3(P3) "Collude but retaliate"
CBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcB
CcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBc
cBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcB
BcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBc
cBcBcBcBcBcBcBcBcBcBcBc
BcBcBcBcBcBcBcBcBcBcBcB
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Section 3 - Game Data for Team E3
--------------------------------------------------------------------------------
0 pt/round: E3(P3) "Collude but retaliate"
0 pt/round: E0(P0) "Collude"
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
--------------------------------------------------------------------------------
-376 pt/round: E3(P3) "Collude but retaliate"
-74 pt/round: E1(P1) "Betray"
cbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcb
BbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBb
cbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbc
BbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbBbB
--------------------------------------------------------------------------------
-199 pt/round: E3(P3) "Collude but retaliate"
-199 pt/round: E2(P2) "Alternate"
CcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBc
CBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcB
BcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBc
cBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcBcB
BcBcBcBcBcBcBcBcBcBcBcB
cBcBcBcBcBcBcBcBcBcBcBc
--------------------------------------------------------------------------------