Created
October 1, 2017 20:14
-
-
Save passcod/fb05a4deee65837d474b460953e09098 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 { permutation } = require('array-permutation') | |
const nouns = ['tucker', 'children', 'school', 'america', 'evil'] | |
function verb (noun) { | |
return noun === 'children' ? 'are' : 'is' | |
} | |
function phrase ([ a, b, c, d, e ]) { | |
return `${a}: ${b} ${verb(b)} learning in ${c} that ${d} ${verb(d)} ${e}` | |
} | |
for (const perm of permutation(nouns)) { | |
console.log(phrase(perm)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment