Original was in coffeescript, so I simply converted to JS to run in browser without dependencies.
- Open browser console
- Paste script above and hit enter
- Type
haiku()
to generate name - Click
Arrow up
and thenEnter
to generate another one - Profit
haiku = function () { | |
var adjs = [ | |
"autumn", "hidden", "bitter", "misty", "silent", "empty", "dry", "dark", | |
"summer", "icy", "delicate", "quiet", "white", "cool", "spring", "winter", | |
"patient", "twilight", "dawn", "crimson", "wispy", "weathered", "blue", | |
"billowing", "broken", "cold", "damp", "falling", "frosty", "green", | |
"long", "late", "lingering", "bold", "little", "morning", "muddy", "old", | |
"red", "rough", "still", "small", "sparkling", "throbbing", "shy", | |
"wandering", "withered", "wild", "black", "young", "holy", "solitary", | |
"fragrant", "aged", "snowy", "proud", "floral", "restless", "divine", | |
"polished", "ancient", "purple", "lively", "nameless" | |
], | |
nouns = [ | |
"waterfall", "river", "breeze", "moon", "rain", "wind", "sea", "morning", | |
"snow", "lake", "sunset", "pine", "shadow", "leaf", "dawn", "glitter", | |
"forest", "hill", "cloud", "meadow", "sun", "glade", "bird", "brook", | |
"butterfly", "bush", "dew", "dust", "field", "fire", "flower", "firefly", | |
"feather", "grass", "haze", "mountain", "night", "pond", "darkness", | |
"snowflake", "silence", "sound", "sky", "shape", "surf", "thunder", | |
"violet", "water", "wildflower", "wave", "water", "resonance", "sun", | |
"wood", "dream", "cherry", "tree", "fog", "frost", "voice", "paper", | |
"frog", "smoke", "star" | |
]; | |
rnd = Math.floor(Math.random() * Math.pow(2, 12)); | |
return adjs[rnd >> 6 % 64] + '-' + nouns[rnd % 64]; | |
} |
You might want to add the
var
keyword on line 24 to avoid adding thernd
variable to the globalwindow
.