mirror of
https://github.com/Lyxminxx/binarian.git
synced 2026-10-11 12:51:48 +02:00
23 lines
682 B
Python
23 lines
682 B
Python
from wordlist import words
|
|
import random
|
|
from os import system, name
|
|
from functions import binarian
|
|
from functions import clear
|
|
|
|
def norToBin(level):
|
|
wordsInLevel = []
|
|
for word, word_level in words.items():
|
|
if word_level == level:
|
|
wordsInLevel.append(word)
|
|
word = random.choice(wordsInLevel)
|
|
correctTranslation = binarian(word)
|
|
|
|
print(f'Translate {word} into binary!')
|
|
userIn = input("Write anwser\n>")
|
|
clear()
|
|
if userIn == correctTranslation:
|
|
print(f'Yes the word {word} does translate to {userIn}!')
|
|
else:
|
|
print(f'No, the word {word} translates to {correctTranslation}. Better study some more!')
|
|
|
|
norToBin(2) |