Advertisement
YankoZlatanov

TheExplorer

Nov 13th, 2014
448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.17 KB | None | 0 0
  1. using System;
  2.  
  3. class TheExplorer
  4. {
  5.     static void Main()
  6.     {
  7.         int input = int.Parse(Console.ReadLine());
  8.         string filling = new string ('-',(input / 2));
  9.         string diamond = "*";
  10.         string topLine = filling + diamond + filling;
  11.         Console.WriteLine(topLine);
  12.         int count;
  13.         for (count = 1; count < (input - 2); count++)
  14.         {
  15.             if (count % 2 == 0)
  16.             {
  17.                 string draw = new string('-', ((input / 2) - (count / 2)));
  18.                 string midDraw = new string('-',(count-1));
  19.                 Console.WriteLine(draw + diamond + midDraw + diamond + draw);
  20.             }
  21.         }
  22.         string middle = new string('-', (input - 2));
  23.         Console.WriteLine(diamond + middle  + diamond);
  24.         for (count = (input - 3); count > 1; count--)
  25.         {
  26.             if (count % 2 == 0)
  27.             {
  28.                 string draw = new string('-', ((input / 2) - (count / 2)));
  29.                 string midDraw = new string('-', (count - 1));
  30.                 Console.WriteLine(draw + diamond + midDraw + diamond + draw);
  31.             }
  32.         }
  33.         Console.WriteLine(topLine);
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement