-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrandom_player.py
More file actions
47 lines (40 loc) · 1.28 KB
/
random_player.py
File metadata and controls
47 lines (40 loc) · 1.28 KB
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
from client import Client
from example_strategy import *
def main():
game_type = 'holdem.limit.2p.reverse_blinds'
ip = 'localhost'
port0 = 43791
port1 = 41291
if game_type == 'renju':
client0 = Client(
game=game_type, decision_func=renju_random_decision,
player_index=0, ip=ip, port=port0
)
client1 = Client(
game=game_type, decision_func=renju_random_decision,
player_index=1, ip=ip, port=port1
)
elif game_type == 'holdem.limit.2p.reverse_blinds':
client0 = Client(
game=game_type, decision_func=poker_threshold_cautious_decision,
player_index=0, ip=ip, port=port0
)
client1 = Client(
game=game_type, decision_func=poker_threshold_aggressive_decision,
player_index=1, ip=ip, port=port1
)
elif game_type == 'LimitLeduc':
client0 = Client(
game=game_type, decision_func=poker_random_decision,
player_index=0, ip=ip, port=port0
)
client1 = Client(
game=game_type, decision_func=poker_random_decision,
player_index=1, ip=ip, port=port1
)
else:
pass
client0.start()
client1.start()
if __name__ == '__main__':
main()