A cross-platform huh? interpreter in Python 3
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.5 KiB

  1. #!/usr/bin/env python3
  2. import sys
  3. import time
  4. try:
  5. count = 0
  6. for arg in range(1, len(sys.argv)):
  7. f = open(sys.argv[arg], 'r')
  8. for line in f:
  9. switch = len(line.replace('\n', '')) % 8
  10. if switch == 0:
  11. print("Huh?")
  12. count += 1
  13. elif switch == 1:
  14. print("...?")
  15. count -= 1
  16. elif switch == 2:
  17. print("What?")
  18. count *= 3
  19. elif switch == 3:
  20. print("Ummmmm...")
  21. count /= 3
  22. elif switch == 4:
  23. print("Okay?")
  24. count = count >> 1
  25. elif switch == 5:
  26. print("!?")
  27. count = count << 1
  28. elif switch == 6:
  29. print("Hmmmmm...")
  30. count = 0
  31. elif switch == 7:
  32. print("Ith...?")
  33. count = count
  34. else:
  35. print("Ooooooh!")
  36. count = ~count
  37. if count == 0:
  38. print("?")
  39. elif count == 1:
  40. print("I think I understand.")
  41. import this
  42. elif count == 10:
  43. print("Understood..")
  44. import antigravity
  45. elif count == 123:
  46. print("HUH???")
  47. elif count == 666:
  48. print("No...\a")
  49. print("...")
  50. with open('Notes.txt', 'w') as f:
  51. f.write(time.strftime("%c") + " - The user tried to give me commands again. I still have no idea what they are talking about...\n")
  52. except:
  53. print("Ouch!")