ivanov_ivan

FallenInLoveLiveDemo

Aug 21st, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.21 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace FallenInLoveLiveDemo
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.             Console.BackgroundColor = ConsoleColor.Black;
  15.             Console.Clear();
  16.  
  17.             int height = 3 * n + 1;
  18.  
  19.             int width = 4 * n + 6;
  20.             int magicVariable = 0;
  21.             for(int row = 0; row < n; row++)
  22.             {
  23.                 string line = "#" + new string('~' , row) + "#" + new string('.' , ( 2 * n ) - magicVariable) + "#" +
  24.                               new string('.' , magicVariable) + "#" + new string('.' , ( 2 * n ) - magicVariable) + "#" +
  25.                               new string('~' , row) + "#";
  26.                 magicVariable += 2;
  27.                 Console.ForegroundColor = ConsoleColor.White;
  28.                 Console.WriteLine(line);
  29.             }
  30.  
  31.             int outerDots = 0;
  32.  
  33.             for(int row = 0; row <= n; row++)
  34.             {
  35.                 string line = "." + new String('.' , outerDots) + "#" + new String('~' , n - row) + "#" + new string('.' , ( 2 * n ) - outerDots) + "#" + new String('~' , n - row) + "#" + new String('.' , outerDots) + ".";
  36.                 Console.ForegroundColor = ConsoleColor.Green;
  37.                 Console.WriteLine(line);
  38.                 outerDots += 2;
  39.             }
  40.  
  41.             for(int row = 0; row < n; row++)
  42.             {
  43.                 //string line = StringCreator(".", (width - 2) / 2) + "##" + StringCreator(".", (width - 2) / 2);
  44.                 string line = new string('.' , ( width - 2 ) / 2) + "##" + new string('.' , ( width - 2 ) / 2);
  45.                 Console.ForegroundColor = ConsoleColor.Red;
  46.                 Console.WriteLine(line);
  47.             }
  48.         }
  49.  
  50.             /* Uncomment when using !!!*/
  51.         //public static string StringCreator(String text, int repeat)
  52.         //{
  53.         //    StringBuilder sb = new StringBuilder();
  54.         //    for (int i = 0; i < repeat; i++)
  55.         //    {
  56.         //        sb.Append(text);
  57.         //    }
  58.         //    return sb.ToString();
  59.         //}
  60.     }
  61. }
Add Comment
Please, Sign In to add comment