Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function skyscraper(input) {
- let n = parseInt(input);
- for (let row = 0; row < n - 3; row++) {
- console.log(' '.repeat(n) + "|" + ' '.repeat(n));
- }
- console.log(' '.repeat(n - 1) + "_|_" + ' '.repeat(n - 1));
- for (let row = 0; row < n - 3; row++) {
- console.log(' '.repeat(n - 1) + "|-|" + ' '.repeat(n - 1));
- }
- console.log(' '.repeat(n - 2) + "_|-|_" + ' '.repeat(n - 2));
- for (let row = 0; row < n - 3; row++) {
- console.log(' '.repeat(n - 2) + "|***|" + ' '.repeat(n - 2));
- }
- console.log('_'.repeat(n - 3) + "|***|" + '_'.repeat(n - 3));
- for (let row = 0; row < n * 4 - 1; row++) {
- console.log(" " + '|'.repeat(n - 2) + "---" + '|'.repeat(n - 2) + " ");
- }
- console.log("_" + '|'.repeat(n - 2) + "---" + '|'.repeat(n - 2) + "_");
- for (let row = 0; row < n - 2; row++) {
- console.log('|'.repeat(n * 2 + 1));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement