Esempio n. 1
0
File: app.py Progetto: p4t0p/game
def game():
    """
        New Game
    """

    new_game = Game()
    return jsonify(new_game.to_json())
Esempio n. 2
0
File: app.py Progetto: p4t0p/game
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)})