Spocoman

Cat Watch

Jan 8th, 2022 (edited)
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function catWatch(input) {
  2.  
  3.     let n = Number(input);
  4.  
  5.     for (let i = 1; i <= n - 2; i++) {
  6.         console.log(`${' '.repeat(n)}||${'_'.repeat(n - 2)}||${' '.repeat(n)}`);
  7.     }
  8.  
  9.     console.log(`${' '.repeat(n - 1)}//${' '.repeat(n)}\\\\${' '.repeat(n - 1)}`);
  10.  
  11.     for (let i = 1; i <= n - 4; i++) {
  12.         console.log(`${' '.repeat(n - 2)}||${' '.repeat(n + 2)}||${(i === Math.floor((n - 3) / 2) ? ']' : '')}`);
  13.     }
  14.  
  15.     console.log(`${' '.repeat(n - 1)}\\\\${' '.repeat(n)}//${' '.repeat(n - 1)}`);
  16.  
  17.     for (let i = 1; i <= n - 2; i++) {
  18.         console.log(`${' '.repeat(n)}||${'_'.repeat(n - 2)}||${' '.repeat(n)}`);
  19.     }
  20.  
  21. }
Add Comment
Please, Sign In to add comment