Haiku Generator Sketch
- Kimberly Agosto
- Dec 7, 2018
- 1 min read
For this sketch I didn't exactly follow the rules of a haiku however I did make it a poem (of some sort) and added interactivity. I decided to create a button, which I had to do using the p5 DOM library, and in this button you would enter your name.

If nothing was put in the field, and the user pressed the button, then this screen would pop up:

But if you put in a name correctly, the name would be shown in the poem in the appropriate spot. For example:

I also used multiple arrays (three) for the three lines of the "poem". I made separate arrays so that the same string would not be chosen twice. A problem I had on this sketch was my inability to add a slider that allowed my sketch's background to change colors. It kept on interfering with the button functionality and I couldn't figure it out.
code: https://editor.p5js.org/kimagosto/sketches/rk06dwj0Q
Comments