baxlash

Illuminati Lock

Jan 25th, 2016
77
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. class IlluminatiLock
  4. {
  5.     public static void Main ()
  6.     {
  7.         int input = int.Parse (Console.ReadLine ());
  8.         int length = 3 * input;
  9.         char eye = '#';
  10.         char filler = '.';
  11.  
  12.         string sideBorder = new string (filler, input);
  13.         string middleBorder = new string (eye, input);
  14.         Console.WriteLine ("{0}{1}{0}", sideBorder, middleBorder);
  15.  
  16.         for (int i = 1; i <= input/2; i++) {
  17.             int sideSpace = input - 2 * i;
  18.             int centerSpace = input - 2;
  19.             int middleSpace = (length - 2 * sideSpace - centerSpace - 6) / 2;
  20.             string side = new string (filler, sideSpace);
  21.             string center = new string (filler, centerSpace);
  22.             string middle = new string (filler, middleSpace);
  23.  
  24.             Console.WriteLine ("{0}##{1}#{2}#{1}##{0}", side, middle, center);
  25.         }
  26.  
  27.         for (int i = input/2; i >0; i--) {
  28.             int sideSpace = input - 2 * i;
  29.             int centerSpace = input - 2;
  30.             int middleSpace = (length - 2 * sideSpace - centerSpace - 6) / 2;
  31.             string side = new string (filler, sideSpace);
  32.             string center = new string (filler, centerSpace);
  33.             string middle = new string (filler, middleSpace);
  34.  
  35.             Console.WriteLine ("{0}##{1}#{2}#{1}##{0}", side, middle, center);
  36.         }
  37.  
  38.         Console.WriteLine ("{0}{1}{0}", sideBorder, middleBorder);
  39.  
  40.     }
  41. }
RAW Paste Data