forked from pascscha/connect4
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_game.py
More file actions
executable file
·35 lines (22 loc) · 816 Bytes
/
Copy pathrun_game.py
File metadata and controls
executable file
·35 lines (22 loc) · 816 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
27
28
29
30
31
32
33
34
35
#!/usr/bin/python3
import time
import logging
from concurrent.futures import ThreadPoolExecutor
from api import GameRunner, ConnectFourClient, RandomPlayerStrategy
from player.implementations import *
from arena import GameParameters
NUMBER_OF_GAMES = 10
SERVER_URL = "https://connect-four-challenge.herokuapp.com/"
def main():
logging.getLogger().setLevel(logging.INFO)
executor = ThreadPoolExecutor(max_workers=1)
client = ConnectFourClient(SERVER_URL)
params = GameParameters(timeout=1)
anker = Count3PlayerHash3(1, params)
future1 = executor.submit(
GameRunner(client=client, player_id='Anker', strategy=anker, number_of_games=NUMBER_OF_GAMES).run)
while not future1.done():
time.sleep(100)
logging.info('Done!')
if __name__ == '__main__':
main()