''' Mission 7 - Personal Billboard Medium Remix 2 This remix uses one list that can contain any items. For the remix, an introductory message, wait loop and ending message are added. -It also includes the button to break the loop and end the program- ''' from codex import * choice = 0 my_list = [GREEN, "Ahoy", pics.HAPPY, pics.SAD, RED, pics.SURPRISED, "Having a great day", pics.ASLEEP, PINK, pics.TIARA, "Meh", pics.TARGET] LAST_INDEX = len(my_list) - 1 # Main Program display.print("Welcome to") display.print("my program") display.print("") display.print("Press L/R to") display.print("scroll the list") display.print("") display.print("Press U to start") display.print("Press D to end") # MAIN PROGRAM # wait loop - program starts when U is pressed while True: if buttons.was_pressed(BTN_U): break # while loop for displaying items from list while True: # display the item my_image = my_list[choice] if type(my_image) == tuple: display.fill(my_image) else: display.show(my_image) # scroll forward and backward if buttons.was_pressed(BTN_L): choice = choice - 1 if choice < 0: choice = LAST_INDEX if buttons.was_pressed(BTN_R): choice = choice + 1 if choice > LAST_INDEX: choice = 0 # break out of loop to quit if buttons.was_pressed(BTN_D): break # Ending message after loop stops display.fill(GREEN) display.show("The End")