Oyunu komut isteminde çalıştırınız.
Ekrandaki sayıları aklınızda tutarak işlemleri gerçekleştirin, doğru yanıtı bulun.
import os
import time
import random
can = 3
seviye = 3
standart = 3
sonuc = random.randint(1,50)
puan = 0
while can > 0:
print(sonuc)
time.sleep(3)
os.system("cls")
while seviye > 0:
islem = random.randint(0,4)
if islem == 1:
sayi = random.randint(1,50)
sonuc += sayi
print("+",sayi)
time.sleep(2)
seviye -= 1
os.system("cls")
if islem == 2:
sayi = random.randint(1,9)
sonuc *= sayi
print("x",sayi)
time.sleep(2)
seviye -= 1
os.system("cls")
if islem == 3:
sayi = random.randint(1,50)
sonuc -= sayi
print("-",sayi)
time.sleep(2)
seviye -= 1
os.system("cls")
if islem == 4:
sayi = random.randint(1,50)
while sonuc % sayi != 0:
sayi = random.randint(1,50)
sonuc /= int(sayi)
print("/",sayi)
time.sleep(2)
seviye -= 1
os.system("cls")
yanit = input("Yanıtınız:")
if yanit == "q":
break
if int(yanit) == sonuc:
print("Doğru yanıt!")
puan += 30
time.sleep(3)
standart += 1
seviye = standart
sonuc = random.randint(1,50)
else:
print("Yanlış yanıt!",sonuc,"olmalıydı.")
time.sleep(3)
puan -= 10
can -= 1
seviye = 3
sonuc = random.randint(1,50)
print("Oyun bitti. Toplam puan:",puan)