from codex import * from time import sleep from random import randrange # Introduction display.print("Press L, R or A") display.print("to see a poem") sleep(2) while True: if buttons.was_pressed(BTN_L): display.fill(GREEN) red = randrange(0, 255) green = randrange(0, 255) blue = randrange(0, 255) color = (red, green, blue) pixels.set(0, color) pixels.set(1, color) pixels.set(2, color) pixels.set(3, color) display.print("Jack and Jill") display.print("went up a hill") display.print("to fetch a pail") display.print("of water.") display.print("") display.print("Jack fell down") display.print("and broke his crown") display.print("and Jill came") display.print("tumbling after") audio.mp3("sounds/roll") if buttons.was_pressed(BTN_R): display.fill(PURPLE) red = randrange(0, 255) green = randrange(0, 255) blue = randrange(0, 255) color = (red, green, blue) pixels.set(0, color) pixels.set(1, color) pixels.set(2, color) pixels.set(3, color) display.print("Hickory dickory ") display.print("dock") display.print("The mouse went up") display.print("the clock") display.print("The clock struck 1") display.print("The mouse ran down") display.print("Hickory dickory ") display.printdock") audio.mp3("sounds/techstyle") if buttons.was_pressed(BTN_A): display.fill(ORANGE) red = randrange(0, 255) green = randrange(0, 255) blue = randrange(0, 255) color = (red, green, blue) pixels.set(0, color) pixels.set(1, color) pixels.set(2, color) pixels.set(3, color) display.print("Little Miss Muffet") display.print("sat on a tuffet") display.print("eating her curds") display.print("and whey") display.print("Along came a spider") display.print("and sat down beside") display.print("her") display.print("And frightened") display.print("Miss Muffet away") audio.mp3("sounds/funk") display.fill(BLACK)