Created
January 21, 2019 16:19
-
-
Save chee/2565d7d4d818ed5f7d60a24bb19df707 to your computer and use it in GitHub Desktop.
goomba.js
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
#!/usr/bin/env node | |
function big (str) { | |
return Array.from(str, letter => letter == ' ' ? ':blank:' : ':b' + letter + ':').join('') | |
} | |
function goomba(str) { | |
const goomba = ':goomba:'; | |
return goomba.repeat(str.length+2) + '\n' + goomba + big(str) + goomba + '\n' + goomba.repeat(str.length+2); | |
} | |
console.log(goomba(process.argv.slice(2).join(" "))) |
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
{ | |
"name": "goomba", | |
"bin": "./goomba.js", | |
"version": "0.0.0-0.0.0" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment