Guest User

Untitled

a guest
Jun 25th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.05 KB | None | 0 0
  1. import random
  2. import string
  3.  
  4.  
  5. #-Pointless functions a'ka Matte is too lazy to make this code Object-Oriented 
  6. def determineIfGivenStringSeemsToBeIntegerValueOrNot (test_value): #-Commentary not needed.
  7.     try:
  8.         int(range_max)
  9.     except ValueError, TypeError:
  10.         return False
  11.     else:
  12.         return True
  13.  
  14. #-----------------------------------------------------------------------
  15.  
  16. print 'The Ultimate Game About Guessing Additive Numbers from range 1 to X'
  17. while True:
  18.     range_max = 0
  19.     nmbr_to_guess = 0
  20.     wild_guess_of_player = 0
  21.     tries = 0
  22.     really_sure_to_exit = False
  23.  
  24.     #-----------------------------------------------------------------------
  25.     while True:
  26.         range_max = raw_input('Choose number for Your Maximum Range: ')
  27.         if determineIfGivenStringSeemsToBeIntegerValueOrNot(range_max):
  28.             range_max = int(range_max)
  29.             break
  30.         else:
  31.             print 'No shit! Im still not that drunk to not recognize what kind of shit are you typing right there!\nTry Again!'
  32.     #-----------------------------------------------------------------------
  33.  
  34.     print 'You made it! Now Ill try to think out a number from 1 to ', range_max
  35.     nmbr_to_guess = random.randint(1, range_max)
  36.     print 'Pheh! That was easy, I guess that II will be good for You!'
  37.     print '''Oh wait! Are You blind? thats not a number, just two capital i's '''
  38.     print 'Enough making fun of You! Now You have to use Your brain to generate random number!'
  39.  
  40.     #-----------------------------------------------------------------------
  41.     while True:
  42.         wild_guess_of_player = raw_input('Please, tell me Your guess: ')
  43.        
  44.        
  45.         #print 'SOME DEBUG\nrange_max: ', range_max,'\nnmbr_to_guess: ', nmbr_to_guess, '\nwild_quess_of_player: ', wild_guess_of_player, '\ntries: ', tries
  46.        
  47.         if not determineIfGivenStringSeemsToBeIntegerValueOrNot(wild_guess_of_player):
  48.             print 'Im not that Stupid, mate!'
  49.         else:
  50.             wild_guess_of_player = int(wild_guess_of_player)
  51.             if wild_guess_of_player > range_max:
  52.                 print 'Bueheheheh. Nice try, But the answer is: WHAT THE FUCK ARE YOU TRYING TO DO'
  53.             else:      
  54.                 if wild_guess_of_player < nmbr_to_guess:
  55.                     print 'Im thinking about higher number, Check in google what is after ', wild_guess_of_player, ' You dumb fuck!'
  56.                    
  57.                 if wild_guess_of_player > nmbr_to_guess:
  58.                     print 'Tm thinking about lower values. Your terapist never said to You that You are too self confident?'
  59.                    
  60.                 if wild_guess_of_player == nmbr_to_guess:
  61.                     print 'Bravo, You are a great person! You made it!'
  62.                     if tries >= 3:
  63.                         print 'Wait! Not so fast! You are so dumb that even pointless game is too har for You!'
  64.                     break
  65.                 tries += 1
  66.  
  67.     print 'Well, Thats all, folk! Wanna play again?'
  68.     while True:
  69.         replay = string.lower(raw_input('(Y)es / (N)o'))
  70.         print replay
  71.         if replay == 'n':
  72.             print 'FUCK YOU!'
  73.             really_sure_to_exit = True
  74.             break
  75.            
  76.         if replay != 'n' and replay != 'y':
  77.             print 'I said! Game is over. And You are still trying to cheat? Do it again, You little fuck!'
  78.            
  79.         if replay == 'y':
  80.             print 'Well, play with me again!'
  81.             break
  82.    
  83.     if really_sure_to_exit:
  84.         break
Add Comment
Please, Sign In to add comment