From a6d779c9fe39062cb0ab08be537e58660633288a Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sat, 30 Sep 2017 14:01:06 -0700 Subject: [PATCH] Make the invalid board message nicer --- tictactoe.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tictactoe.py b/tictactoe.py index 73e8292..08ba506 100644 --- a/tictactoe.py +++ b/tictactoe.py @@ -162,7 +162,9 @@ def hello(): try: board = Board(request.args.get('board', None)) except ValueError: - return ("Invalid board.", 400, {'Content-type': 'text/plain'}) + out = 'Invalid board.' + out += "\n\nPass a 'board' parameter to define the board, e.g. x+o++oxo+" + return (out, 400, {'Content-type': 'text/plain'}) if not board.is_o_turn: return ("It isn't O's turn.\n\n{}".format(board), 400, {'Content-type': 'text/plain'})