Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function drawFort(input) {
- let n = Number(input[0]);
- let x = n > 4 ? n * 2 - (n / 2 + 2) * 2 : 0;
- console.log(`/${'^'.repeat(n / 2)}\\${'_'.repeat(x)}/${'^'.repeat(n / 2)}\\`);
- for (let i = 0; i < n - 3; i++) {
- console.log(`|${' '.repeat(n * 2 - 2)}|`);
- }
- console.log(`|${' '.repeat((n * 2 - (x + 2)) / 2)}${'_'.repeat(x)}${' '.repeat((n * 2 - (x + 2)) / 2)}|`,);
- console.log(`\\${'_'.repeat(n / 2)}/${' '.repeat(x)}\\${'_'.repeat(n / 2)}/`);
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement