Advertisement
Guest User

Codebreaker

a guest
Dec 6th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. import random
  2.  
  3. code = random.randint(1000,9999)
  4. cmd = 0
  5. attempts = 30
  6. puzzle1 = 1
  7. puzzle2 = 0
  8.  
  9. while puzzle1 == 1:
  10.     cmd = int(input(">>> "))
  11.     if cmd > code:
  12.         print("Too high!")
  13.         attempts = attempts - 1
  14.         print(attempts)
  15.     if cmd < code:
  16.         print("Too low!")
  17.         attempts = attempts - 1
  18.         print(attempts)
  19.     if cmd == code:
  20.         print("Access granted!")
  21.         puzzle1 = 0
  22.         puzzle2 = 1
  23. while puzzle2 == 1:
  24.     pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement