''' Mission 8 Answer Bot Starter code for personal pictogram ''' from codex import * import random from time import sleep # My list of pictures, colors and text my_images = [pics.TIARA, GREEN, pics.PLANE, "hello!", pics.HAPPY, BLUE, pics.TARGET, "what's up?", RED, "Ahoy", pics.HEART] # my list of JPG pics uploaded to Codex # Introduction display.print("A=images", scale=3) display.print("B=pictures", scale=3) display.print("D=quit", scale=3) while True: pixels.set(0, random.choice(COLOR_LIST)) pixels.set(1, random.choice(COLOR_LIST)) pixels.set(2, random.choice(COLOR_LIST)) pixels.set(3, random.choice(COLOR_LIST)) # Display random item when BTN_A is pressed if buttons.was_pressed(BTN_A): item = random.choice(my_images) if type(item) == tuple: display.fill(item) else: display.show(item) # Display random picture when BTN_B is pressed # Break loop if BTN_D is pressed # Ending message display.clear() display.print("Thanks", scale=5)