''' Mission 9 Remix 2B Uses a color list instead of the arrows list Use button D to end game ''' from codex import * import random from time import sleep my_colors = [GREEN, RED, BLUE, YELLOW, PURPLE, ORANGE] LAST_INDEX = len(my_colors) - 1 def spin_animation(count): index = 0 loops = 0 delay = 0.05 while loops < count: loops = loops + 1 display.fill(my_colors[index]) sleep(delay) delay = delay + 0.02 index = index + 1 if index > LAST_INDEX: index = 0 # Main Program while True: if buttons.is_pressed(BTN_A) or buttons.is_pressed(BTN_B): count = random.randrange(12, 19) spin_animation(count) #show_random_color() if buttons.is_pressed(BTN_D): break display.clear() display.print("Thanks",scale=4)