GogoK

02.Heart-training

Jan 21st, 2015
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.38 KB | None | 0 0
  1. using System;
  2.  
  3. class Heart
  4. {
  5.     static void Main()
  6.     {
  7.         //Console.WriteLine("Enter size: ");
  8.         //byte size = byte.Parse(Console.ReadLine());
  9.         byte size = 16;
  10.         char heart = '♥';
  11.  
  12.         for (byte i = 0; i <= size / 2 - i; i++)
  13.         {
  14.             if (i == 0)
  15.             {
  16.                 Console.Write("{0}{1}{0}", new string(' ', size / 4), heart);
  17.                 Console.WriteLine("{0}{1}{0}", new string(' ', size / 4), heart);
  18.             }
  19.             else if (i != 0)
  20.             {
  21.                 Console.Write("{0}{1}{2}{1}{0}", new string(' ', ((size / 4) - i)), heart, new string((' '), (i * 2) - 1));
  22.                 Console.WriteLine("{0}{1}{2}{1}{0}", new string(' ', ((size / 4) - i)), heart, new string((' '), (i * 2) - 1));
  23.             }
  24.         }
  25.         for (byte a = 0; a < size / 2; a++)
  26.         {
  27.             Console.WriteLine("{0}{1}{2}{1}{0}", new string(' ', a + 1), heart, new string(' ', (size - a) - a - 2));
  28.         }
  29.  
  30.  
  31.  
  32.         //  1:            2:             2:
  33.         //    @    @         @   @         1   1
  34.         //   @ @  @ @       @ @ @ @        2   2
  35.         //  @   @@   @     @   @   @     123212321
  36.         //   @      @       @     @          2
  37.         //    @    @         @   @           3
  38.         //     @  @           @ @            2
  39.         //      @@             @             1
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment