Guest User

Untitled

a guest
Jan 22nd, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. def makelist(visited,state): ## note that state is actually a node information: unintentional
  2. ## misnomer. visited is my node information dictionary.
  3. direc = state
  4. ExplList = []
  5. while not direc[1] == 'LStart':
  6. ExplList.append(direc)
  7. direc = visited[direc[-1]]
  8. ## at this point, I have reconstructed the entire list of nodes. its only filtering
  9. ## from here on out.
  10. ExplList2 = []
  11. for x in range(len(ExplList)):
  12. if ExplList[x][1] != 'LStart':
  13. ExplList2.append(ExplList[x][1])## taking only the directions from my list of nodes.
  14. ExplList2.reverse()
  15. return ExplList1, ExplList2;
Add Comment
Please, Sign In to add comment