Skip to content

Instantly share code, notes, and snippets.

@cazetto
Created December 22, 2016 00:03
Show Gist options
  • Save cazetto/6912de924bac7e7d01c39b38c34cfe75 to your computer and use it in GitHub Desktop.
Save cazetto/6912de924bac7e7d01c39b38c34cfe75 to your computer and use it in GitHub Desktop.
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