def connections(N): result = [0] * N combination = [0] * N for switch in range(N): combination[switch] = 1 result[switch] = driver.tryCombination(combination) combination[switch] = 0 return result
def combo(N): positions = [0] * N for i in range(0, N): if (driver.tryCombination(positions) == i): positions[i] = 1 return positions