Skip to content

Instantly share code, notes, and snippets.

@bsturdivan
Last active March 8, 2024 22:19
Show Gist options
  • Save bsturdivan/c41e0bb500b79f6b56a78ac5b303f13e to your computer and use it in GitHub Desktop.
Save bsturdivan/c41e0bb500b79f6b56a78ac5b303f13e to your computer and use it in GitHub Desktop.
const BLOCK_SIZE = 4
const phrases = [
"Happy Birthday Lauren Conrad",
"Night Shade / Moon Beam",
"Escapement",
"Light / Leicht",
"Cap 3",
"Grapehene",
"Undercurrent / Watershed",
"Webtape",
"Re:Age",
"AirMake",
"Exit Music (For a Job)",
"Brunch at Foreign Cinema",
"SPQR 10pm",
"Wake",
"Eternal",
"Grown Up",
"Yearning",
]
const textBlock = new Set()
while (textBlock.size !== BLOCK_SIZE) {
const index = Math.floor(Math.random() * phrases.length) - 1
textBlock.add(phrases[index])
}
const sortedBlock = [...textBlock].sort(
(a, b) => a.split('').length - b.split('').length
)
const blockToPrint = [
sortedBlock[0],
sortedBlock[2],
sortedBlock[1],
sortedBlock[3],
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment