-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.py
More file actions
36 lines (32 loc) · 991 Bytes
/
cli.py
File metadata and controls
36 lines (32 loc) · 991 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
36
import sys
from utils.game_modes import (
start_game_against_minimax,
start_train_network,
start_game_against_network
)
class TicTacToeCLI:
"""
CLI para:
1) jogo contra Minimax
2) treinamento via AG
3) jogo contra rede treinada
Convenção de peças (alinhada ao treinamento):
+1 → X
-1 → O
"""
def start(self):
while True:
print(f"""{5* '='} MENU {5 * '='}\n1 - Jogar contra Minimax (modo humano)\n2 - Treinar IA com AG
3 - Jogar contra IA treinada\n0 - Sair""")
cmd = input("Escolha: ").strip()
if cmd == "1":
start_game_against_minimax()
elif cmd == "2":
start_train_network()
elif cmd == "3":
start_game_against_network()
elif cmd == "0":
print("Até logo!")
sys.exit(0)
else:
print("Opção inválida. Tente novamente.")