Advertisement
Stann

Eggcelent

Apr 5th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.00 KB | None | 0 0
  1. using System;
  2. class Eggcelent
  3. {
  4.     static void Main()
  5.     {
  6.         int n = int.Parse(Console.ReadLine());
  7.         int height = 2 * n;
  8.         int width = (3 * n) - 1;
  9.         int widthD = (3 * n) + 1;
  10.         int top = n - 1;
  11.         int bottom = n - 1;
  12.         //Top
  13.         Console.WriteLine("{0}{1}{0}",new string('.',n + 1),new string('*',top));
  14.         int outerDots = n - 1;
  15.         int innerDots = n + 1;
  16.         int counter = 0;
  17.         for (int i = 0; i < height - n - 2; i++)
  18.         {
  19.             Console.WriteLine("{0}*{1}*{0}",new string('.',outerDots),new string('.',innerDots));
  20.             innerDots+=4;
  21.             outerDots-=2;
  22.             if (outerDots < 0)
  23.             {
  24.                 outerDots = 1;
  25.                 counter++;
  26.             }
  27.             if (innerDots > width)
  28.             {
  29.                 innerDots = width - 2;
  30.             }
  31.         }
  32.         //Middle
  33.         Console.Write(".*");
  34.         for (int i = 0; i < width/2; i++)
  35.         {
  36.             Console.Write("@");
  37.             if(i > width/2-2)
  38.             {
  39.                 break;
  40.             }
  41.             Console.Write(".");
  42.         }
  43.         Console.WriteLine("*.");
  44.         Console.Write(".*");
  45.         for (int i = 0; i < width / 2; i++)
  46.         {
  47.             Console.Write(".");
  48.             if (i > width / 2 - 2)
  49.             {
  50.                 break;
  51.             }
  52.             Console.Write("@");
  53.         }
  54.         Console.WriteLine("*.");
  55.         //Bottom
  56.         int innerDots2 = 1;
  57.         int outerDots2 = width - 2;
  58.         for (int i = 0; i < height - n - 2; i++)
  59.         {
  60.             Console.WriteLine("{0}*{1}*{0}", new string('.', innerDots2), new string('.', outerDots2));
  61.             if (counter-1 > i)
  62.             {
  63.                 innerDots2 = widthD - width - 1;
  64.                 outerDots2 = width - 2;
  65.             }
  66.             else
  67.             {
  68.                 innerDots2 += 2;
  69.                 outerDots2 -= 4;
  70.             }
  71.         }
  72.         Console.WriteLine("{0}{1}{0}",new string('.',n +1),new string('*',bottom));
  73.     }
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement