Skip to content

Instantly share code, notes, and snippets.

@nelsonfncosta
Last active May 27, 2021 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nelsonfncosta/397bae754142afda81f98663c2800a4c to your computer and use it in GitHub Desktop.
Save nelsonfncosta/397bae754142afda81f98663c2800a4c to your computer and use it in GitHub Desktop.
hast-tag-pyramid.js
let size = prompt("size?");
for(let i=1; i<=size; i++) console.log("#".repeat(i));
let size = prompt("size?")
for(let i=1; i<= size; i++){
let buffer = ' '.repeat(size-i)
let side = '#'.repeat(i-1)
console.log(`${buffer}${side} ${side}${buffer}`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment