-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame.py
More file actions
34 lines (21 loc) · 773 Bytes
/
game.py
File metadata and controls
34 lines (21 loc) · 773 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
from models.calcular import Calcular
def main() -> None:
pontos: int = 0
jogar(pontos)
def jogar(pontos: int) -> None:
dificuldade: int = int(input('Informe o nível de dificulade desejado [1, 2, 3 ou 4]: '))
calc: Calcular = Calcular(dificuldade)
print('Informe o resultado para a seguinte operacação: ')
calc.mostrar_operacao()
resultado: int = int(input())
if calc.checar_resultado(resultado):
pontos += 1
print(f'Você tem {pontos} pontos(s).')
continuar: int = int(input('Deseja continuar no jogo? [1 - sim, 0 - não] '))
if continuar:
jogar(pontos)
else:
print(f'Você finalizou com {pontos} ponto(s).')
print('Até a próxima!')
if __name__ == '__main__':
main()