Ejemplo n.º 1
0
 def what_month():
     print "What month were you born?"
     month = raw_input()
     if is_month(month) == False:
         print month + " is not a month that I understand. Just give me the number of the month and that will be good enough."
         defs.confirm()
         what_month()
     return int(month)
Ejemplo n.º 2
0
 def what_year():
     print "What year were you born?"
     year = raw_input()
     if is_year(year) == False:
         print year + " is not year. Your health is no laughing matter " + name + "."
         defs.confirm()
         what_year()
     return int(year)
Ejemplo n.º 3
0
 def confirm_file():
     print "I tried writing your name and birthdate down in your patient file."
     print "Why don't you check and see if the file is in the folder."
     print "Was it there?"
     check_patient_file = raw_input()
     if check_patient_file == "yes":
         print "Good. You can be confident I know how to write."
         defs.confirm()
         return True
     elif check_patient_file == "no":
         print "I guess I suck at being a doctor"
         return False
     else:
         print "I only understand yes or no. It's a doctor thing."
Ejemplo n.º 4
0
 def main_menu(self):
     os.system("clear")
     print "Welcome to DiceRoller!"
     print "1. 1 player roll a 6 sided die"
     print "2. 2 player roll a 6 sided die against Python."
     print "3. Quit"
     input = raw_input()
     if input == "1":
         os.system("clear")
         roll = random.randint(1, 6)
         print("You rolled a " + str(roll))
         defs.confirm()
         self.main_menu()
     elif input == "2":
         self.play_python()
     elif input == "3":
         defs.main_menu()
     else:
         self.main_menu()
Ejemplo n.º 5
0
 def again(self):
     again = raw_input("Would you like to play again?")
     if again == "yes":
         os.system("clear")
         self.play()
     elif again == "no":
         os.system("clear")
         self.score()
         print "Thanks for playing! Goodbye, " + defs.read_name()
         if self.player_score == self.python_score:
             print "We tied " + str(self.player_score) + " " + str(
                 self.python_score) + "! You are great competition!"
         elif self.python_score > self.player_score:
             print "Just for the record I win " + str(
                 self.python_score) + " to " + str(self.player_score) + "."
             print "Which means I'm better than you. And thanks to my creator I talk shit like this."
         else:
             print "Somehow you beat me even though the odds are in my favor."
         defs.confirm()
         defs.main_menu()
     else:
         print "I only understand yes or no thanks to my all knowing creator"
         self.again()
Ejemplo n.º 6
0
 def game_over(self):
     if self.player_score == self.python_score:
         print "Thanks for playing. I guess we are evenly matched."
         defs.confirm()
     elif self.player_score > self.python_score:
         print "It's offical. You're better than me. But that's okay because I'll still be here assuming my creator doesn't screw it up."
         defs.confirm()
     else:
         print "See you later loser. Come back when you grow a pair."
         defs.confirm()