def game(): """ New Game """ new_game = Game() return jsonify(new_game.to_json())
def move(): """ Player Move """ try: game = Game(request.json['field'], { 'turn': request.json['turn'], 'eaten': request.json['eaten'], 'check': request.json['check'], }) game.move(request.json['move']) return jsonify(game.to_json()) except Exception as e: # traceback.print_exception(e) return jsonify({'error': str(e)})