Advertisement
Spocoman

Illuminati Lock

Oct 12th, 2023
800
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function illuminatiLock(input) {
  2.     let n = Number(input[0]);
  3.  
  4.     console.log(`${'.'.repeat(n)}${'#'.repeat(n)}${'.'.repeat(n)}`);
  5.  
  6.     for (let i = 0; i < n - 1; i += 2) {
  7.         console.log(`${'.'.repeat(n - i - 2)}##${'.'.repeat(i)}#${'.'.repeat(n - 2)}#${'.'.repeat(i)}##${'.'.repeat(n - i - 2)}`);
  8.     }
  9.  
  10.     for (let i = n - 3; i >= 0; i -= 2) {
  11.         console.log(`${'.'.repeat(n - i - 2)}##${'.'.repeat(i)}#${'.'.repeat(n - 2)}#${'.'.repeat(i)}##${'.'.repeat(n - i - 2)}`);
  12.     }
  13.  
  14.     console.log(`${'.'.repeat(n)}${'#'.repeat(n)}${'.'.repeat(n)}`);
  15.  
  16.     return;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement