Published
Edited
Feb 22, 2021
Insert cell
md`# Dizzy`
Insert cell
md`The concept: Poem about spinning in an office/hotel chair. Each letter of the poem flashes through letters of the alphabet in order. When the correct letter for a position appears, it flashes green. The viewer must press space bar when letters turn green for those letter positions to stop spinning. To reveal the entire poem, the player must press space bar at the correct time for every letter group. The longer they take to solve the poem, the faster the letters spin, so it's in their best interest to get it right the first time. If by 4 minutes the player has failed to finish the puzzle, the letters shake and blur before returning into focus. Then, slowly, the letters correct themselves. This is meant to simulate the sensation of spinning in a chair--the fun adrenolyn at the beginning, follow by panic once the dizzy kicks in.

If I have time, though honestly I think I'm gonna have my hands full with the current code, I want to add ambient music in the background that distorts and layers over itself the faster the letters spin. Once user input stops, whether because the user figured out the poem or because they lapsed 4 minutes, the music plays in reverse, and the distortions fade away. Finally, at the very end, the music reverses back to the original direction and plays a final, concluding phrase.`
Insert cell
md`While writing I spun in my chair
and I felt my skin hitting air.
After some spinning
my head was swimming,
a feeling this code seeks to share.
`

Insert cell
md`<pre>
poem = Array()[words of the poem]
alphabet = Array(26)["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
poem_copy = Array(length(poem))[ones or something idk]

Loop to flash through letters
Basically different poem_copy(n) = alphabet(m) at different times
rate increases over time

if poem(n) = alphabet(current number)
letter turns green
if space bar pressed
if poem(k) = alphabet(current number)
break loop (aka stop cycling through letters)
else
letter turns red for half a second, but cycling continues

*after all loops are written for letter clusters*

if poem = poem_copy
music reverses? Tbh not sure whether I should worry about music rn
if poem ~= poem_copy
words shake
pause
for 1:number of letter clusters
fix one letter cluster
pause
</pre>`
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more