Created
December 22, 2016 00:03
-
-
Save cazetto/6912de924bac7e7d01c39b38c34cfe75 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var SIZE = 40, | |
count = 0, | |
result = '', | |
rec; | |
(rec = () => { | |
var unfilledSide = ((SIZE - count) / 2) | 0; | |
result += | |
Array(unfilledSide).join(' ') + | |
Array(count).join('*') + | |
Array(unfilledSide).join(' ') + '\n'; | |
SIZE > ++count ? rec() : null; | |
})(); | |
console.log(result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment