Output the board as a 1D list of characters
This commit is contained in:
parent
d285d8087e
commit
f74433c7c7
1 changed files with 3 additions and 1 deletions
|
@ -170,11 +170,13 @@ def hello():
|
|||
return ("It isn't O's turn.\n\n{}".format(board), 400, {'Content-type': 'text/plain'})
|
||||
|
||||
next_board = board.move()
|
||||
out = str(next_board)
|
||||
if bool(os.environ.get('TTT_DEBUG', False)):
|
||||
import pprint
|
||||
out = str(next_board)
|
||||
out += '\n\n---------- DEBUG ----------'
|
||||
out += '\n\nInput:\n{}'.format(board)
|
||||
out += '\n\nScore: {}'.format(board.score)
|
||||
out += '\n\nChildren:\n{}'.format(pprint.pformat(board.children))
|
||||
else:
|
||||
out = next_board.board
|
||||
return (out, 200, {'Content-type': 'text/plain'})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue