Exemplo n.º 1
0
    In this game, you will be given a simple
    arithmetic question.
    Each correct answer gives you one mark.
    No mark is deducted for wrong answers.
    """

    binaryInstructions = """
    In this game, you will be given a number in base 10.
    Your task is to conver this number to base 2.
    Each correct answer gives you one mark.
    No mark is deducted for wrong answers.
    """

    newUser = True
    userChoice = 0
    bg = BinaryGame()
    mg = MathGame()

    name = input("Please enter your name: ")
    score = int(getUserScore(name))
    print("Current Score: {0}".format(score))

    if score == -1:
        newUser = True
        score = 0
    else:
        newUser = False

    print("Welcome to the Math Game")

    while userChoice != -1:
Exemplo n.º 2
0
    binary_instructions = '''
    In this game, you will be given a number in base 10.
    Your task is to convert this number to base 2.
    Each correct answer gives you one mark.
    No mark is deducted for wrong answers.
    '''

    hex_instructions = '''
    In this game, you will be given a number in base 10.
    Your task is to convert this number to base 16.
    Each correct answer gives you one mark.
    No mark is deducted for wrong answers.
    '''

    mg = MathGame()
    bg = BinaryGame()
    hg = HexGame()

    userName = input("\nPlease enter your username: "******"\nHello {0}, welcome to the game.".format(userName))
    print("Your current score is {0}.".format(score))