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
# function sort | |
from random import randint | |
def welcome(): | |
print("Bem-vindo ao jogo da adivinhação.") | |
print("\n\n") | |
name = input("Qual o seu nome? ") | |
print("\n\n") | |
print("Começaremos o jogo para você, {}".format(name)) |
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
# function sort | |
from random import randint | |
def welcome(): | |
print("Bem-vindo ao jogo da adivinhação.") | |
print("\n\n") | |
name = input("Qual o seu nome? ") | |
print("\n\n") | |
print("Começaremos o jogo para você, {}".format(name)) |
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
def verify(kick, number_secret): | |
if kick == number_secret: | |
print("Parabéns!!! Você acertou!") | |
return True | |
else: | |
print("Humm.. Você errou!") | |
larger = number_secret > kick | |
if larger: | |
print("O número secreto é maior!") | |
else: |
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
def get_number(kicks, attempt, limit): | |
print("\n\n\n") | |
print("Tentativa {} de {}.".format(attempt, limit)) | |
print("Chutes atá agora: {}".format(kicks)) | |
kick = int(input("Escolha um número: ")) | |
print("Será que você acertou?? Você escolheu o número: {}".format(kick)) | |
return kick |
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
def sort(): | |
print("\n\n") | |
print("Escolhendo um número secreto entre 0 e 200...") | |
number_secret = randint(0,200) | |
print("Escolhido ... Que tal adivinhar hoje nosso número secreto?") | |
return number_secret |
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
def welcome(): | |
print("Bem-vindo ao jogo da adivinhação.") | |
print("\n\n") | |
name = input("Qual o seu nome? ") | |
print("\n\n") | |
print("Começaremos o jogo para você, {}".format(name)) |
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
def welcome | |
puts "Bem-vindo ao jogo da adivinhação." | |
puts "\n\n" | |
puts "Qual é o seu nome?" | |
name = gets | |
puts "\n\n" | |
puts "Começaremos o jogo para você, #{name}" | |
end | |
def sort |
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
welcome | |
number_secret = sort | |
limit = 10 | |
kicks = [] |
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
def welcome | |
puts "Bem-vindo ao jogo da adivinhação." | |
puts "\n\n" | |
puts "Qual é o seu nome?" | |
name = gets | |
puts "\n\n" | |
puts "Começaremos o jogo para você, #{name}" | |
end | |
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
def verify kick, number_secret | |
hit = kick == number_secret | |
if hit | |
puts "Parabéns, você acertou :)" | |
return true | |
else | |
puts "Humm... você errou :(" | |
larger = number_secret > kick |
NewerOlder