Created
July 18, 2013 13:05
-
-
Save fmasanori/6029123 to your computer and use it in GitHub Desktop.
Jogo simples em Python 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from random import randint | |
| print ('Bem vindo!') | |
| sorteado = randint(1, 100) | |
| chute = 0 | |
| while chute != sorteado: | |
| chute = int(input ('Chute: ')) | |
| if chute == sorteado: | |
| print ('Você venceu!') | |
| else: | |
| if chute > sorteado: | |
| print ('Alto') | |
| else: | |
| print ('Baixo') | |
| print ('Fim do jogo!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
class JogoDaVela:
tabuleiro = {'7': ' ', '8': ' ', '9': ' ', '4': ' ', '5': ' ', '6': ' ', '1': ' ', '2': ' ', '3': ' '}
turno = None
jogo = JogoDaVela()
jogo.jogar()