from schoginitoys import *
opposites_dict = {
"above": "below",
"absent": "present",
"accept": "reject",
"arrive": "depart",
"begin": "end",
"best": "worst",
"better": "worse",
"big": "small",
"black": "white",
"bright": "dull",
"buy": "sell",
}
# Initialize variables
current_word = urandom.choice(list(opposites_dict.keys()))
while True:
scroll(f"Word: {current_word.upper()}")
# Check if button is pressed
if Config.up or Config.down:
Config.up = False
Config.down = False
current_word = urandom.choice(list(opposites_dict.keys()))
scroll(f"Next Word: {current_word.upper()}")
if Config.right or Config.button_pressed:
Config.right = False
Config.button_pressed = False
scroll(f"Opposite is: {opposites_dict[current_word].upper()}")
# Debounce button
time.sleep(0.5)
if Config.left:
Config.button_pressed = False
break
scroll("Ended")