Jednoduchá hra v Pythonu.
Sure, here is a simple game in Python where the player has to guess a randomly generated number:
„`python
import random
def guess_number():
number = random.randint(1, 100)
print(„Guess a number between 1 and 100:“)
while True:
guess = int(input(„Enter your guess: „))
if guess < number:
print("Too low, try again.")
elif guess > number:
print(„Too high, try again.“)
else:
print(„Congratulations! You guessed the number.“)
break
if __name__ == „__main__“:
guess_number()
„`
You can run this code in a Python environment and try to guess the randomly generated number. Enjoy the game!