week4–generative text output

Concept

The idea for this project came from a hilarious clip I watched of The Tonight Show Starring Jimmy Fallon, where Jimmy played a word-association game with Benedict Cumberbatch (who plays Doctor Strange). In the game, Jimmy would ask random, nonsensical questions, and Benedict had to shout out random words—verbs, nouns, adjectives—without thinking. In the end, all those completely unrelated words were stuffed into a pre-written script, creating a surprisingly funny and absurd little story.

I loved how something as simple as pulling random words out of context could instantly create unexpected comedy. That made me wonder: Can I recreate that same feeling of hilarious randomness using code?

By setting up three separate word banks—subjects, verbs, and objects—and picking one from each using p5.js’s random()function, this project acts as a mini story generator. Every time you click, it stitches together a completely unpredictable sentence, turning basic code into a fun, surreal storytelling game.

How this was made?

The overall logic of this program is very clean and straightforward, without any unnecessary complexity. First, I stored 20 words into three separate arrays for subjects, verbs, and objects. Next, I set up mousePressed() so that every time you click, the code uses random() to pull one random item from each of those three arrays.

To make it look more polished, I played around with typography, positioning, and color. I arranged the three parts vertically using specific Y-coordinates, picked a nice clean font, and made the middle verb bright red so it stands out as the action of the sentence.

Reflection

To be honest, this project was relatively simple, and I intentionally kept my approach straightforward without overcomplicating things. I focused on building a clean, functional logic that works reliably rather than wrestling with complex algorithms.

However, looking at the finished piece, I definitely see room to make the user experience much richer in the future:Adding subtle, soft typing sound effects whenever a new sentence is generated to give the clicks better tactile feedback.Or experimenting with fade-in effects or gentle motion trails so the words slide in smoothly instead of just abruptly popping onto the screen.

Leave a Reply