-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathTeam7Fix.py
36 lines (30 loc) · 1.12 KB
/
Team7Fix.py
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
import random
team_name = 'Team7'
strategy_name= 'B or C because H'
strategy_description = 'the first round I am going to betray, and then in the other rounds depending on whether they betrayed or colluded in the prevoius round the code will have a higher chance to betray or collude that round.'
def move(my_history, their_history, my_score, their_score):
mynumbB = 74
mynumbC = 64
p = random.randint(1,100)
if len(my_history) == 0:
return 'b'
elif len(my_history) == 50:
if their_history.count('b') > their_history.count('c'):
mynumbB += 5
elif their_history.count('b') < their_history.count('c'):
mynumbC += 5
elif len(my_history) == 100:
if their_history.count('b') > their_history.count('c'):
mynumbB += 8
elif their_history.count('b') < their_history.count('c'):
mynumbC += 8
elif len(my_history) >= 1 and their_history[-1] == 'b':
if p <= mynumbB:
return 'b'
else:
return 'c'
elif len(my_history) >= 1 and their_history[-1] == 'c':
if P <= mynumbC:
return 'c'
else:
return 'b'