Added '--play' flag, so you can now play against the ai.
This commit is contained in:
parent
2c02689577
commit
00974b0f11
22
board.py
22
board.py
|
@ -230,19 +230,17 @@ class Board:
|
||||||
#print("boards after first die: ", boards)
|
#print("boards after first die: ", boards)
|
||||||
|
|
||||||
for die in roll[1:]:
|
for die in roll[1:]:
|
||||||
# if die != 0:
|
# Calculate boards resulting from second move
|
||||||
if True:
|
nested_boards = [calc_moves(board, die) for board in boards]
|
||||||
# Calculate boards resulting from second move
|
#print("nested boards: ", nested_boards)
|
||||||
nested_boards = [calc_moves(board, die) for board in boards]
|
boards = [board for boards in nested_boards for board in boards]
|
||||||
#print("nested boards: ", nested_boards)
|
# What the fuck
|
||||||
boards = [board for boards in nested_boards for board in boards]
|
#for board in boards:
|
||||||
# What the fuck
|
# print(board)
|
||||||
#for board in boards:
|
# print("type__:",type(board))
|
||||||
# print(board)
|
# Add resulting unique boards to set of legal boards resulting from roll
|
||||||
# print("type__:",type(board))
|
|
||||||
# Add resulting unique boards to set of legal boards resulting from roll
|
|
||||||
|
|
||||||
#print("printing boards from calculate_legal_states: ", boards)
|
#print("printing boards from calculate_legal_states: ", boards)
|
||||||
legal_moves = legal_moves | set(boards)
|
legal_moves = legal_moves | set(boards)
|
||||||
# print("legal moves: ", legal_moves)
|
# print("legal moves: ", legal_moves)
|
||||||
if len(legal_moves) == 0:
|
if len(legal_moves) == 0:
|
||||||
|
|
3
main.py
3
main.py
|
@ -205,6 +205,9 @@ if __name__ == "__main__":
|
||||||
if not config['train_perpetually']:
|
if not config['train_perpetually']:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
elif args.play:
|
||||||
|
network = Network(config, config['model'])
|
||||||
|
network.play_against_network()
|
||||||
|
|
||||||
elif args.eval:
|
elif args.eval:
|
||||||
network = Network(config, config['model'])
|
network = Network(config, config['model'])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user