Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main():
- helpdisp = 0
- tower_cmd(helpdisp)
- def tower_cmd(helpdisp):
- try:
- if helpdisp == 0:
- print('enter \'help\' without quotes for more info')
- helpdisp = 1
- inpdat = input('TOWERMUD>')
- print(inpdat[0], ' !')
- lightparser(inpdat)
- except Exception as exc:
- print('an error has occured!')
- print('the error is: ', exc)
- print('unable to handle error!')
- finally:
- tower_cmd(helpdisp)
- def lightparser(inpdat1):
- if inpdat1[0] == 'a':
- ainpdat(inpdat1)
- if inpdat1[0] == 'b':
- binpdat(inpdat1)
- if inpdat1[0] == 'c':
- cinpdat(inpdat1)
- if inpdat1[0] == 'd':
- dinpdat(inpdat1)
- if inpdat1[0] == 'e':
- einpdat(inpdat1)
- if inpdat1[0] == 'f':
- finpdat(inpdat1)
- if inpdat1[0] == 'g':
- ginpdat(inpdat1)
- if inpdat1[0] == 'h':
- hinpdat(inpdat1)
- if inpdat1[0] == 'i':
- iinpdat(inpdat1)
- if inpdat1[0] == 'j':
- jinpdat(inpdat1)
- if inpdat1[0] == 'k':
- kinpdat(inpdat1)
- if inpdat1[0] == 'l':
- linpdat(inpdat1)
- if inpdat1[0] == 'm':
- minpdat(inpdat1)
- if inpdat1[0] == 'n':
- ninpdat(inpdat1)
- if inpdat1[0] == 'o':
- oinpdat(inpdat1)
- if inpdat1[0] == 'p':
- pinpdat(inpdat1)
- if inpdat1[0] == 'q':
- qinpdat(inpdat1)
- if inpdat1[0] == 'r':
- rinpdat(inpdat1)
- if inpdat1[0] == 's':
- sinpdat(inpdat1)
- if inpdat1[0] == 't':
- tinpdat(inpdat1)
- if inpdat1[0] == 'u':
- uinpdat(inpdat1)
- if inpdat1[0] == 'v':
- vinpdat(inpdat1)
- if inpdat1[0] == 'w':
- winpdat(inpdat1)
- if inpdat1[0] == 'x':
- xinpdat(inpdat1)
- if inpdat1[0] == 'y':
- yinpdat(inpdat1)
- if inpdat1[0] == 'z':
- zinpdat(inpdat1)
- def ainpdat(inpdat2):
- #print('what you entered began with the letter A')
- #this is coded into the computer's or should I say programs structure?
- brklist = mediumparser(inpdat2)
- def binpdat(inpdat2):
- brklist = mediumparser(inpdat2)
- def cinpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def dinpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def einpdat(inpdat2):
- if inpdat2 == 'exit':
- exit()
- print('did you mean exit?: ', inpdat2[0])
- brkrslt = mediumparser(inpdat2)
- def finpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def ginpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def hinpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def iinpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def jinpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def kinpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def linpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def minpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def ninpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def oinpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def pinpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def qinpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def rinpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def sinpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def tinpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def uinpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def vinpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def winpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def xinpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def yinpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def zinpdat(inpdat2):
- brkrslt = mediumparser(inpdat2)
- def mediumparser(inpdat3):
- spaceswitch = 0
- overticker = 0
- thesentence = "this sentence is to count the spaces"
- wordlist = []
- while spaceswitch == 0:
- spaces = thesentence.find(' ')
- wordlist[overticker] = thesentence[0:spaces] # this is where we save the words at
- thesentence = thesentence[spaces:len(thesentence)] # this is where we change the sentence for the
- # next run-through
- print('here2')
- print(wordlist)
- print(spaces)
- if spaces == 0:
- spaceswitch = 1
- overticker = overticker + 1
- if overticker == 20:
- quit()
- print(thesentence)
- print('space> ', spaces)
- return(wordlist)
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement