def children2(original): output = [] #Generate the 8 children strings for the original board #and return them in the list named output return output def children(base): output = [] moves=["A","A'","B","B'","C","C'","D","D'"] transition= [ [3,0,2,4,1,5,6,7,8], [1,4,2,0,3,5,6,7,8], [0,4,1,3,5,2,6,7,8], [0,2,5,3,1,4,6,7,8], [0,1,2,6,3,5,7,4,8], [0,1,2,4,7,5,3,6,8], [0,1,2,3,7,4,6,8,5], [0,1,2,3,5,8,6,4,7]] board = list(base) for index1 in range(len(transition)): c = "" for index2 in range(len(transition[index1])): c = c + board[transition[index1][index2]] output.append(c) return output