Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- ans1 = random.randint(100, 899)
- prob = random.randint(1, 25)
- close1 = (ans1 - 100)
- close2 = (ans1 + 100)
- close3 = (ans1 - 25)
- close4 = (ans1 + 25)
- troll1 = (ans1 - prob)
- troll2 = (ans1 + prob)
- hund = (ans1 // 100)
- num1 = int(input("Guess the code: "))
- if num1 == ans1:
- print("\nWow! Way to ruin the fun")
- else:
- print("\nHint: It is a three digit code")
- num2 = int(input("Guess again: "))
- if num2 == ans1:
- print("\nSecond try! Impressive.")
- elif num2 > close1 and num2 < close2:
- print("\nSo close!")
- num3 = int(input("Guess again! "))
- else:
- print("\nNot even close.")
- print("\nHint #2: " + str(hund) + "__")
- num3 = int(input("Guess again! "))
- if num3 == ans1:
- print("\nFinally. Congrats.")
- elif num3 > close3 or num3 < close4:
- print("\nYou are atleast 25 away from your number!")
- print("You have one last try.")
- print("The answer is " + str(troll2))
- num4 = int(input("Last guess: "))
- else:
- print("\nOkay. One last try. The answer is " + str(troll1) + ". One number is a lie.")
- num4 = int(input("Last guess: "))
- if num4 == ans1:
- print("\nYou failed at guessing the wrong number.")
- elif (num3 > close3 or num3 < close4) and num4 != troll2:
- print("\nShould have guessed " + str(troll2) + ".")
- print("But it was actually " + str(ans1))
- elif num4 != troll1:
- print("\nShould have guessed " + str(troll1) + ".")
- print("But it was actually " + str(ans1))
- else:
- print("\nShould have guessed " + str(ans1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement