Пожалуйста, не могли бы кто-нибудь помочь мне понять, что здесь не так ... он просто останавливается после первого предположения
правила игры указаны в тексте print () - спасибо
import random
num = random.randint(1,100)
print("WELCOME TO GUESS ME!")
print("I'm thinking of a number between 1 and 100")
print("If your guess is more than 10 away from my number, I'll tell you you're COLD")
print("If your guess is within 10 of my number, I'll tell you you're WARM")
print("If your guess is farther than your most recent guess, I'll say you're getting COLDER")
print("If your guess is closer than your most recent guess, I'll say you're getting WARMER")
print("LET'S PLAY!")
xs = [0]
while True:
x = int(input("I'm thinking of a number between 1 and 100.\n What is your guess? "))
if x < 1 or x > 100:
print('OUT OF BOUNDS! Please try again: ')
continue
if x == num:
print(f'CONGRATULATIONS, YOU GUESSED IT IN ONLY {len(xs)} GUESSES!!')
break
xs.append(x)
if xs[-2]:
if abs(num-x) < abs(num-x[-2]):
print('WARMER!')
else:
print('COLDER!')
else:
if abs(num-x) <= 10:
print('WARM!')
else:
print('COLD!')