Creative Code Prompts

Twelve prompts that treat code as a medium for expression rather than a tool for utility. Some need a few lines. Some need a weekend. All of them ask the same question: what does this feel like, not just what does this do.

12 prompts · Updated April 2026

PROMPT 01

Build a generative art piece that creates a unique pattern every time it runs.

Generative art is where most coders first discover that programming can be expressive. The setup is simple: a canvas, a seeded random number, and a few rules. The output is endlessly varied. That gap between simple rules and complex output is the entire appeal of the form.

Start with one rule and add the second only when the first feels exhausted. A single rule like "draw a circle at a random position with a random size" can produce a remarkable range of outputs once you tune the distribution. Resist over-engineering. The strongest generative pieces tend to have fewer parameters than their authors initially want them to have.

PROMPT 02

Code a simple animation that responds to mouse movement in an unexpected way.

Mouse-driven animation is the most direct form of interactive art. The user moves; the screen moves. The question is whether the relationship between those two motions is interesting. Linear mapping — cursor moves right, shape moves right — is boring. Anything else has a chance to be a small piece of magic.

Try inversion. Try delay. Try acceleration that builds the longer the mouse stays still. Try a shape that follows but resists. Try a shape that gets repelled by the cursor. Each unexpected behavior is its own miniature relationship between user and screen, and the prompt is a vehicle for prototyping those relationships quickly.

PROMPT 03

Create a webpage that changes its entire design based on the time of day.

This prompt sits at the intersection of design and code. You are not just toggling a dark mode at sundown. You are imagining what the page should be at 3 p.m., at 11 p.m., at 5 a.m. — and committing to a different visual language for each. The site has moods, and the time of day is the input.

The interesting design work is in the transitions. Does the morning version look like it grew out of the night version? Does noon feel like a peak the page is descending from by 4 p.m.? A page that does this well becomes a kind of slow ambient companion — different to visit at different hours, the way a window in your house is different at different hours.

PROMPT 04

Build a tiny app that translates text into a visual pattern or color palette.

Text-to-visual translation is an old idea with infinite implementations. You can hash characters into colors. You can map letter frequency to shape size. You can run sentiment analysis and pick a palette accordingly. The implementation is up to you. The interesting decision is the rule.

Pick a rule that says something. Mapping vowels to warm colors and consonants to cool ones produces a visualization that means something different from mapping the position of each letter in the alphabet to hue. Different rules surface different qualities of text. The tool you build is opinionated by virtue of which rule you chose, and that opinion is the art.

PROMPT 05

Write a script that generates random poetry by remixing famous opening lines.

Constraint-based poetry generation is a tradition that predates computers. Cut-up methods, Oulipo experiments, surrealist exquisite corpse — all of these are remixing operations performed by hand. Code lets you scale and randomize the operation, which sometimes surfaces juxtapositions a human editor would have rejected.

The corpus you choose is the soul of the project. Famous opening lines from novels produces one kind of music. Famous opening lines from horror films produces a completely different one. Tax codes, lullabies, museum placards — every corpus has its own grain, and the remix amplifies that grain into something the original would never have shown you.

PROMPT 06

Create an interactive sketch where clicking adds elements that interact with physics.

Physics simulation is one of the most satisfying things to code because the output feels alive. Drop a ball, it falls. Add gravity, it accelerates. Add bounce, it bounces. Add friction, it slows. Add other balls, they collide. The user clicks, and behavior emerges that you did not directly script — that is the goal.

Aim for emergence, not control. The most rewarding versions of this prompt are the ones where the user can spawn enough elements that the system starts surprising even you. Pattern formation, clustering, accidental stability, accidental chaos — once you have a working physics loop, the sketch becomes a toy that keeps revealing new behaviors the longer you watch.

PROMPT 07

Build a CSS-only animation that tells a mini story in a loop.

Pure-CSS animation is a discipline. No JavaScript, no canvas, no SVG manipulation — just keyframes and transitions on HTML elements. The constraint reminds you how much expression is built into the cascade itself, and how much can be done with very little code.

Loop length is the design challenge. A short loop encourages quick gags. A longer loop encourages a real narrative arc — a setup, a development, a payoff, a return to the start. Try a 15-second loop with three discrete acts. The format will push you to think about pacing in a way that one-off animations do not.

PROMPT 08

Code a visualizer that turns any paragraph of text into abstract art.

This prompt is a cousin of the text-to-pattern prompt, but it leans further into abstraction. The goal is not a useful diagram. The goal is something that hangs together aesthetically when fed any text. That is a higher bar — your algorithm has to produce work that is not only meaningful but also visually composed.

The best implementations tend to have one parameter that scales gracefully. Word count, sentence length, vowel density — whatever you choose, it should produce small elegant outputs for short inputs and complex compositions for long ones. The visualization scales with the language, and that scaling is part of what makes it feel like a real piece of generative work rather than a one-trick demo.

PROMPT 09

Create a web toy that makes satisfying sounds and visuals when you interact with it.

Web toys are software that does not need to be useful. They exist to be touched. The Wii menu music, the iPhone unlock sound, the click of a well-designed switch — every great interaction has a satisfying micro-feedback loop, and a web toy is an entire artifact built out of that feedback.

Lean on audio. Most coders neglect sound when they should be obsessing over it. A click that goes thunk with the right reverb is more satisfying than the most carefully animated visual. Pair the audio with a visual that feels causally connected — pressed in, expanded, rippled, snapped — and the toy starts feeling like a tiny physical instrument rather than a webpage.

PROMPT 10

Build something that takes a boring dataset and makes it beautiful.

Data visualization is a form of translation. Numbers that mean nothing in a spreadsheet become something legible when they are turned into shape, color, position, and motion. The prompt asks you to do that for data that is, on its face, unappealing.

The boring-er the dataset, the more interesting this exercise gets. Government rainfall records. The chemical composition of supermarket bread. The shipping weights of every book on your shelf. Once you commit to a dataset most people would scroll past, the burden is on you to find the story or the beauty in it. That burden produces real work.

PROMPT 11

Write a program that draws with math — spirals, fractals, or Lissajous curves.

Mathematical drawing has been delighting people since the spirograph. The formulas are simple. The outputs are not. A few sine and cosine functions, parameterized over time, produce shapes that would take an hour to draw by hand and still not look as clean.

Pick one formula and explore it fully before moving on. Lissajous curves alone have entire careers built around them. Vary one parameter at a time and watch what happens. The discipline of staying with a single mathematical object until you have seen what it can do is the discipline of doing mathematical art well, instead of just sampling tricks.

PROMPT 12

Create an interactive experience that only works if two people use it together.

Two-person interactions are radically underexplored in software. Most apps assume a single user staring at a screen alone. A piece that requires two people in the same room with the same device — or two devices talking to each other — is a different kind of software, and it tends to be memorable for that reason alone.

Lean on the collaboration. The experience should not be playable solo. One person draws while the other person sees the drawing happen in real time and adds to it. Two phones held face-to-face form an instrument when their accelerometers are synced. The point is to design something that requires the other person, so the social interaction itself becomes part of the work.

Advertisement

Ready to open your editor?

Generate a random prompt and start building.

Spark Me ✦