Created
July 24, 2023 14:58
-
-
Save vsizov/4e952a34ac5efc070b6dd08a97b1c24b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
BotCount = 0 # Score | |
Count = 0 | |
print("hi, now you are going to play with numbers") | |
print("your goal is to say number which is greater then computer's") | |
#print("# you can't use same number twice") | |
print("to continue write 'OK'") | |
startAnswer = input() | |
print("you can coose your number'from' and 'to'") | |
loopFrom = input("from:") | |
loopTo = input("to:") | |
while True: | |
print("you can coose your number from ", loopFrom, " to", loopTo) | |
choice = int(input("select your number")) | |
loopFrom1 = choice - 10 | |
loopTo1 = choice + 10 | |
BotChoice = random.randint(loopFrom1, loopTo1) | |
print("builder info; ", loopFrom1, loopTo1, choice, BotChoice) | |
print("computer's number is ", BotChoice) | |
if choice < BotChoice: | |
BotCount = BotCount + 1 | |
if choice > BotChoice: | |
Count = Count + 1 | |
print("computer's count is: ", BotCount, "your count is: ", Count) | |
if BotCount == 3: | |
print("computer win(") | |
print("try again!") | |
break | |
if Count == 3: | |
print("you win)") | |
print("my congratulations!") | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment