Last active
March 8, 2024 22:19
-
-
Save bsturdivan/c41e0bb500b79f6b56a78ac5b303f13e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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