a guest Jan 22nd, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand