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