Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #PlayAgain?
- TheEnd = "Is_Near"
- while TheEnd != "exit":
- #Presentation
- print("\n***GUESS THE WORD*** \n \n First, ask a friend to type a lowercase password \n(and don't dare to peek)")
- Password = input("\nType a mean word, Sir!\nPassword(lowercase):")
- print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nNow, watch your friend struggling to guess it 8)")
- # Letter_Count - Returns default hint value
- def Letter_Count(word, letter):
- L_Counter = 0
- for L in word:
- if L == letter:
- L_Counter += 1
- return L_Counter
- Try_Counter = 0
- Try = "SpamAndEggs"
- # Code loops until someone inputs the right password.
- while not Try == Password:
- #HINTS output code:
- print("\nEnter a single character to get a hint:")
- x = input()
- if len(x) != 1:
- print("\nI said a SINGLE character!!!")
- continue
- Try_Counter += 1
- print("\nThis character appears {0} times within the secret word" "and takes {1}% of it's size".format(Letter_Count(Password,x),round(100*Letter_Count(Password,x)/len(Password))))
- #Making more interesting hints
- if Password.startswith(x):
- print("\nAlso, that is password's first letter! \n")
- if Password.endswith(x):
- print("\nAlso, that is password's last letter! \n")
- #GUESS checking code
- Try = input("Give it a guess: ")
- if Try == "42":
- print("\nAccording to an ASI from a remote galaxy, Input() == True. \nHowever, this is a crappy Phyton code that is not able to even aknolowedge itself, so...")
- if Try != Password:
- if Try_Counter >= 25:
- print ("\nOkay loser, Password is", Password)
- if Try_Counter >= 3:
- print ("\nNope, try again. You have missed", Try_Counter ,"times already.")
- else :
- print ("\nUh... No.")
- #Ending.
- if Try_Counter == 1:
- print ("\nYou'd better rush to the nearer casino, you lucky bastard!")
- else:
- print("\nYup, that's right. You can have your cake now.")
- #Replay?
- Pacience = 0
- while TheEnd != "R":
- TheEnd = input("\nEnter 'exit' to... Er, exit. Or type 'R' to replay. \nPlease don't try typing anything else: ")
- if TheEnd == "exit":
- exit()
- else:
- Pacience += 1
- if Pacience == 1:
- print("\n*#@&!!")
- if Pacience == 2:
- print("\nF#@&!!")
- if Pacience == 3:
- print("\nFoo!!!")
- continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement