fonkensemble

path

Jan 4th, 2026
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import sys
  2.  
  3. dirmap = {"north": "n", "northeast": "ne", "east": "e", "southeast": "se", "south": "s", "southwest": "sw", "west": "w", "northwest": "nw", "down": "d", "up": "u"}
  4.  
  5. def get_paths():
  6. with open("paths.txt", "r") as f:
  7. lines = f.readlines()
  8. dir_l = [dirmap[l.split('"')[1]] for l in lines if l[:8] == "The word"]
  9. print("::".join(dir_l))
  10. print("----- number of steps:", len(dir_l))
  11.  
  12.  
  13. if __name__ == '__main__':
  14. get_paths()
Advertisement
Add Comment
Please, Sign In to add comment