Skip to content

Instantly share code, notes, and snippets.

@arferreira
Created October 26, 2017 14:52
Show Gist options
  • Save arferreira/5c565d54cd3e64cef6806c58f82dbe3f to your computer and use it in GitHub Desktop.
Save arferreira/5c565d54cd3e64cef6806c58f82dbe3f to your computer and use it in GitHub Desktop.
# 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))
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
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
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:
print("O número secreto é menor!")
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment