-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathteam1.py
More file actions
27 lines (24 loc) · 781 Bytes
/
team1.py
File metadata and controls
27 lines (24 loc) · 781 Bytes
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
####
# 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 = 'LostCauses' # Only 10 chars displayed.
strategy_name = '75-25'
strategy_description = '75% betray, 25% collude'
def move(my_history, their_history, my_score, their_score):
'''This function makes it a 75% betray, 25% collude situation/strategy =, ir betrays to lower opponents score.'''
opponent_b = 0
for decision in their_history:
if decision == 'b':
opponent_b+=1
if len(their_history)==0:
return "c"
else:
if opponent_b/len(their_history)>0.25 or their_score > my_score:
return 'b'
else:
return 'c'
print(opponent_b)