Beispiel #1
0
    def Play(request):
        # FIXME: Data sent from client is not JSON.
        # Figure out how to actually send json.
        cell = eval(request.request.json["cell"])
        row, column = cell["location"]
        grid = eval(request.request.json["grid"])
        flag_event = request.request.json.get("flag_cell")

        board = Board(grid)
        board.handle_move(row, column, flag_event)

        return {"grid": board.grid, "winner": board.winner}