''' Mission 9 Remix 1C Arrows spin counter clockwise instead of clockwise Index starts at top index nd decrements instead of increments Includes button to stop program. ''' from codex import * import random from time import sleep def show_random_arrow(): arrow = random.randrange(8) display.show(pics.ALL_ARROWS[arrow]) def spin_animation_counter(count): index = len(pics.ALL_ARROWS) - 1 loops = 0 delay = 0.0 while loops < count: loops = loops + 1 display.show(pics.ALL_ARROWS[index]) sleep(delay) delay = delay + 0.005 index = index - 1 if index == -1: index = len(pics.ALL_ARROWS) - 1 while True: if buttons.is_pressed(BTN_A) or buttons.is_pressed(BTN_B): spin_animation_counter(20) show_random_arrow() if buttons.is_pressed(BTN_D): break display.clear() display.print("Thanks",scale=4)