def action_from_number(move, player, sw, dice_roll):
    """ Takes the output of the network, samples from the probs, does the move if possible, returns move_type,  the move itself and the move number"""
    board = sw.board
    move_number = move * 1
    start_loc = 9, 9
    for row in board.board:
        for cell in row:
            if cell.player == player:
                start_loc = cell.y, cell.x
    if start_loc == (9, 9):
        action = player, (9, 9), (9, 9), dice_roll, False, False
        return 'dead', action, 0
    drone, pj = False, False
    move_type = ''
    if move // 64 == 0:
        move_type = 'normal'
    elif move // 64 == 1:
        move -= 64
        pj = True
        move_type = 'powerjump'
    else:
        move -= 128
        drone = True
        move_type = 'drone'
    x = move // 8
    y = move % 8
    action = player, start_loc, (x, y), dice_roll, drone, pj
    return move_type, action, move_number
