Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/**
.
...
.....
.......
.........
*/
let node = 1;
let initMaxWidth = 5;
while (node <= 5) {
let points = node;
let maxWidth = initMaxWidth;
while (points <= 9) {
const line = ''.padStart(points, '.').padStart(maxWidth, ' ');
console.log(line);
points += 2;
maxWidth += 1;
}
node += 2;
initMaxWidth += 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment