Ejemplo n.º 1
0
def play(difficulty):
    domain = DOMAINS[difficulty]
    translations = []
    for decimal_value in domain:
        str_value = str(decimal_value).strip()
        hex_value = hex(decimal_value).strip()
        translations.append((str_value, hex_value))

    quizzer.play_loop(translations)
Ejemplo n.º 2
0
def play(difficulty):
    domain = DOMAINS[difficulty]
    translations = []
    for decimal_value in domain:
        str_value = str(decimal_value).strip()
        hex_value = hex(decimal_value).strip()
        translations.append((str_value, hex_value))

    quizzer.play_loop(translations)
Ejemplo n.º 3
0
def play(mode):
    translations = []
    for character in CHARACTERS:
        if mode == DECIMAL_MODE:
            translation = str(ord(character))
        elif mode == HEX_MODE:
            translation = hex(ord(character))
        else:
            help_and_exit()
        if character in SPECIAL_CASES:
            character = SPECIAL_CASES[character]
        translations.append((character, translation))

    quizzer.play_loop(translations)