-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame.py
More file actions
35 lines (21 loc) · 735 Bytes
/
game.py
File metadata and controls
35 lines (21 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from models.calculate import Calculate
def main() -> None:
points: int = 0
play(points)
def play(points: int) -> None:
difficulty: int = int(input("Informe o nível de dificuldade desejado [1, 2, 3 ou 4]: "))
calc = Calculate(difficulty)
print("Informe o resultado para a seguinte operação: ")
calc.show_operation()
result: int = int(input())
if calc.check_result(result):
points += 1
print(f"Você tem {points} ponto(s).")
keep: int = int(input("Deseja continuar jogando? [1 - Sim, 0 - Não]: "))
if keep:
play(points)
else:
print(f"Você finalizou com {points} ponto(s).")
print("Até a próxima!")
if __name__ == "__main__":
main()