Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def makelist(visited,state): ## note that state is actually a node information: unintentional
- ## misnomer. visited is my node information dictionary.
- direc = state
- ExplList = []
- while not direc[1] == 'LStart':
- ExplList.append(direc)
- direc = visited[direc[-1]]
- ## at this point, I have reconstructed the entire list of nodes. its only filtering
- ## from here on out.
- ExplList2 = []
- for x in range(len(ExplList)):
- if ExplList[x][1] != 'LStart':
- ExplList2.append(ExplList[x][1])## taking only the directions from my list of nodes.
- ExplList2.reverse()
- return ExplList1, ExplList2;
Add Comment
Please, Sign In to add comment