From c725d3764d8525f1071b33f1b9f841749678e339 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sat, 30 Sep 2017 13:32:33 -0700 Subject: [PATCH] A little script to exercise the Board manually --- play.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 play.py diff --git a/play.py b/play.py new file mode 100755 index 0000000..580a67f --- /dev/null +++ b/play.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 + +import sys +import pprint + +from tictactoe import Board + +start = Board(sys.argv[1]) +start_score = start.evaluate() +print('Start:\n{}\n\nScore: {}'.format(start, start_score)) +print('\nChildren:') +pprint.pprint(list(reversed(sorted(start.children, key=lambda b: b.score)))) + +print('\nNext move:\n{}'.format(start.move()))