Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // *********** n
- // ********* n - 2
- // ******* n - 4
- // *** n - 8
- // * n - 10
- let treeHeight = 10;
- treeHeight *= 2;
- for (let troncoL = 0; troncoL < 3; troncoL++) {
- let tronco = "";
- for (let t = 0; t < treeHeight / 2 - 1; t++) tronco += " ";
- tronco += "*";
- console.log(tronco);
- }
- for(let i = treeHeight; i > 0; i -= 2) {
- let s = "";
- for(let j = 0; j < (treeHeight - i) / 2; j++ ) {
- s += " ";
- }
- for(let j = 0; j < i - 1; j++) {
- s += "*";
- }
- console.log(s);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement