Advertisement
Guest User

Untitled

a guest
Mar 28th, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. def make_ll(self):
  2. linked_list = ll.LinkedList()
  3. print(linked_list)
  4. for word in self.init_list:
  5. if len(word) == int(self.word_length):
  6. linked_list.append(str(word))
  7. self.linked_list = linked_list
  8.  
  9. def init_family(self, guess):
  10.  
  11. self.dictionary = {}
  12. cursor = self.linked_list.head
  13. while cursor != None:
  14. word = cursor.data
  15. cursor = cursor.next
  16. word = self.make_families(word, guess)
  17.  
  18. def make_families(self, word, guess):
  19. count = 0
  20. new_word = ""
  21. for c in word:
  22.  
  23. if guess == c:
  24. count += 1
  25. else:
  26. new_word = word.replace(c, "-")
  27. print(new_word)
  28.  
  29. if count == 0:
  30. self.linked_list.delete(word)
  31.  
  32. return word
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement