-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
45 lines (37 loc) · 1.3 KB
/
main.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
37
38
39
40
41
42
43
44
#import comgames.AI.tictactoeai as ttt
#
#ttt.Q_learning_train()
#ttt.run()
#ttt.run("defensive")
from comgames.__version__ import __version__
import comgames.play.main as m
import argparse
available_games = [
'fourinarow',
'Gomoku',
'tictactoe',
'Reversi',
]
available_algos = [
"QLearning",
"SARSA",
"ExpectedSARSA",
]
game_list = '\n- '.join([
'',
*available_games
])
description = f"Board games: {game_list}"
parser = argparse.ArgumentParser(description=description, prefix_chars='-+')
parser.add_argument('-v', '--version', help='show version', version=__version__, action='version')
parser.add_argument('-g', '--game', help='Game name', choices=available_games, default='tictactoe')
parser.add_argument('--host', help='Host a game online')
parser.add_argument('-p', '--port', help='Port', type=int, default=9999)
parser.add_argument('-c', '--connect', help='Connect to a server, \'host:port\'')
parser.add_argument('--ai', help='Play with AI.', action="store_true")
parser.add_argument('-t', '--train', help='Train an agent.', action="store_true")
parser.add_argument('-a', '--algorithm', help='Specify algorithms', choices=available_algos)
#parser.add_argument('-n', '--new', help='Create a new agent.', action="store_true")
args = parser.parse_args()
#m.main(args)
m.main(args)