Advertisement
Guest User

Untitled

a guest
May 14th, 2017
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.50 KB | None | 0 0
  1. def main():
  2. helpdisp = 0
  3. tower_cmd(helpdisp)
  4.  
  5. def tower_cmd(helpdisp):
  6. try:
  7. if helpdisp == 0:
  8. print('enter \'help\' without quotes for more info')
  9. helpdisp = 1
  10.  
  11. inpdat = input('TOWERMUD>')
  12.  
  13. print(inpdat[0], ' !')
  14. lightparser(inpdat)
  15.  
  16. except Exception as exc:
  17. print('an error has occured!')
  18. print('the error is: ', exc)
  19. print('unable to handle error!')
  20. finally:
  21. tower_cmd(helpdisp)
  22.  
  23. def lightparser(inpdat1):
  24. if inpdat1[0] == 'a':
  25. ainpdat(inpdat1)
  26. if inpdat1[0] == 'b':
  27. binpdat(inpdat1)
  28. if inpdat1[0] == 'c':
  29. cinpdat(inpdat1)
  30. if inpdat1[0] == 'd':
  31. dinpdat(inpdat1)
  32. if inpdat1[0] == 'e':
  33. einpdat(inpdat1)
  34. if inpdat1[0] == 'f':
  35. finpdat(inpdat1)
  36. if inpdat1[0] == 'g':
  37. ginpdat(inpdat1)
  38. if inpdat1[0] == 'h':
  39. hinpdat(inpdat1)
  40. if inpdat1[0] == 'i':
  41. iinpdat(inpdat1)
  42. if inpdat1[0] == 'j':
  43. jinpdat(inpdat1)
  44. if inpdat1[0] == 'k':
  45. kinpdat(inpdat1)
  46. if inpdat1[0] == 'l':
  47. linpdat(inpdat1)
  48. if inpdat1[0] == 'm':
  49. minpdat(inpdat1)
  50. if inpdat1[0] == 'n':
  51. ninpdat(inpdat1)
  52. if inpdat1[0] == 'o':
  53. oinpdat(inpdat1)
  54. if inpdat1[0] == 'p':
  55. pinpdat(inpdat1)
  56. if inpdat1[0] == 'q':
  57. qinpdat(inpdat1)
  58. if inpdat1[0] == 'r':
  59. rinpdat(inpdat1)
  60. if inpdat1[0] == 's':
  61. sinpdat(inpdat1)
  62. if inpdat1[0] == 't':
  63. tinpdat(inpdat1)
  64. if inpdat1[0] == 'u':
  65. uinpdat(inpdat1)
  66. if inpdat1[0] == 'v':
  67. vinpdat(inpdat1)
  68. if inpdat1[0] == 'w':
  69. winpdat(inpdat1)
  70. if inpdat1[0] == 'x':
  71. xinpdat(inpdat1)
  72. if inpdat1[0] == 'y':
  73. yinpdat(inpdat1)
  74. if inpdat1[0] == 'z':
  75. zinpdat(inpdat1)
  76.  
  77. def ainpdat(inpdat2):
  78. #print('what you entered began with the letter A')
  79. #this is coded into the computer's or should I say programs structure?
  80. brklist = mediumparser(inpdat2)
  81.  
  82. def binpdat(inpdat2):
  83. brklist = mediumparser(inpdat2)
  84.  
  85. def cinpdat(inpdat2):
  86. brkrslt = mediumparser(inpdat2)
  87.  
  88. def dinpdat(inpdat2):
  89. brkrslt = mediumparser(inpdat2)
  90.  
  91. def einpdat(inpdat2):
  92. if inpdat2 == 'exit':
  93. exit()
  94. print('did you mean exit?: ', inpdat2[0])
  95. brkrslt = mediumparser(inpdat2)
  96.  
  97. def finpdat(inpdat2):
  98. brkrslt = mediumparser(inpdat2)
  99.  
  100. def ginpdat(inpdat2):
  101. brkrslt = mediumparser(inpdat2)
  102.  
  103. def hinpdat(inpdat2):
  104. brkrslt = mediumparser(inpdat2)
  105.  
  106. def iinpdat(inpdat2):
  107. brkrslt = mediumparser(inpdat2)
  108.  
  109. def jinpdat(inpdat2):
  110. brkrslt = mediumparser(inpdat2)
  111.  
  112. def kinpdat(inpdat2):
  113. brkrslt = mediumparser(inpdat2)
  114.  
  115. def linpdat(inpdat2):
  116. brkrslt = mediumparser(inpdat2)
  117.  
  118. def minpdat(inpdat2):
  119. brkrslt = mediumparser(inpdat2)
  120.  
  121. def ninpdat(inpdat2):
  122. brkrslt = mediumparser(inpdat2)
  123.  
  124. def oinpdat(inpdat2):
  125. brkrslt = mediumparser(inpdat2)
  126.  
  127. def pinpdat(inpdat2):
  128. brkrslt = mediumparser(inpdat2)
  129.  
  130. def qinpdat(inpdat2):
  131. brkrslt = mediumparser(inpdat2)
  132.  
  133. def rinpdat(inpdat2):
  134. brkrslt = mediumparser(inpdat2)
  135.  
  136. def sinpdat(inpdat2):
  137. brkrslt = mediumparser(inpdat2)
  138.  
  139. def tinpdat(inpdat2):
  140. brkrslt = mediumparser(inpdat2)
  141.  
  142. def uinpdat(inpdat2):
  143. brkrslt = mediumparser(inpdat2)
  144.  
  145. def vinpdat(inpdat2):
  146. brkrslt = mediumparser(inpdat2)
  147.  
  148. def winpdat(inpdat2):
  149. brkrslt = mediumparser(inpdat2)
  150.  
  151. def xinpdat(inpdat2):
  152. brkrslt = mediumparser(inpdat2)
  153.  
  154. def yinpdat(inpdat2):
  155. brkrslt = mediumparser(inpdat2)
  156.  
  157. def zinpdat(inpdat2):
  158. brkrslt = mediumparser(inpdat2)
  159.  
  160. def mediumparser(inpdat3):
  161. spaceswitch = 0
  162. overticker = 0
  163. thesentence = "this sentence is to count the spaces"
  164. wordlist = []
  165. while spaceswitch == 0:
  166. spaces = thesentence.find(' ')
  167. wordlist[overticker] = thesentence[0:spaces] # this is where we save the words at
  168. thesentence = thesentence[spaces:len(thesentence)] # this is where we change the sentence for the
  169. # next run-through
  170. print('here2')
  171. print(wordlist)
  172. print(spaces)
  173. if spaces == 0:
  174. spaceswitch = 1
  175. overticker = overticker + 1
  176. if overticker == 20:
  177. quit()
  178.  
  179. print(thesentence)
  180. print('space> ', spaces)
  181. return(wordlist)
  182.  
  183.  
  184. if __name__ == '__main__':
  185. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement