NJ Makers Day: Code A Poetry Generator
Celebrate New Jersey Makers Day with us at Made@NPL! Learn to code a poetry generator using BBC:Micro Bit and Microsoft Make Code, a coding app.
What is a poetry generator?
The poetry generator project creates random phrases that you can use in a poem, as a password or to start a story. It’s nice to share especially poetic or funny phrases with your friends.
What will you learn?
You will learn about arrays, a special kind of variable. Arrays are a useful way of storing data in lists.
How it works
- When you shake your BBC micro:bit, a random phrase is created that consists of an adjective, noun, verb, then adverb, for example, ‘beautiful bird eats swiftly’.
- You can either use your phrase to start a poem or alongside other phrases generated by this program to write an entire poem.
- The program uses four arrays called ‘adjectives’, ‘nouns’, ‘verbs’, and ‘adverbs’.
- Each array stores a list of words. Each item in an array is called an element. The elements are numbered with an index. For example, the array ‘noun’ includes three elements: element 0, bird; element 1, butterfly; and element 2, dragonfly. The indices are numbered from 0 because computers start counting at 0.
- When you shake your micro:bit, a random number between 0 and 2 is chosen for each array. The elements for those indices are shown on the micro:bit’s LED display.
Sign up here: https://npl.libcal.com/event/14096269
ABOUT MADE@NPL
Made@NPL is a community resource located at Newark Public Library’s Main Branch that provides all Newarkers access to in-demand equipment, technology, and software, to use at no cost.
Made@NPL supports creative entrepreneurs with business reference services and programming related to creativity, entrepreneurship, and making things.
Made@NPL was funded by a generous grant from the PNC Foundation. To schedule an individual session, visit www.made.npl.org.
ABOUT MAKERS DAY
New Jersey Makers Day inspires and activates libraries to showcase and highlight STEM and maker culture, enhancing life-long learning. Visit https://njmakersday.org/about/ for more information.
