Advertisement
milislavski

FireInTheMatrix

Apr 17th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.65 KB | None | 0 0
  1.     using System;
  2.  
  3.     class FireInTheMatrix
  4.     {
  5.         static void Main()
  6.         {
  7.             //top row
  8.             int width = int.Parse(Console.ReadLine());
  9.             int topDots = (width / 2) - 1;
  10.             Console.Write(new string('.', topDots));
  11.             Console.Write(new string('#', 2));
  12.             Console.WriteLine(new string('.', topDots));
  13.  
  14.             for (int i = 0; i < (width / 2) - 2; i++)
  15.             {
  16.                 topDots--;
  17.                 Console.Write(new string('.', topDots));
  18.                 Console.Write('#');
  19.                 Console.Write(new string('.', i + 1));
  20.                 Console.Write(new string('.', i + 1));
  21.                 Console.Write('#');
  22.                 Console.WriteLine(new string('.', topDots));
  23.             }
  24.  
  25.             Console.Write('#');
  26.             Console.Write(new string('.', width - 2));
  27.             Console.WriteLine('#');
  28.             Console.Write('#');
  29.             Console.Write(new string('.', width - 2));
  30.             Console.WriteLine('#');
  31.  
  32.             int bottomDots = 0;
  33.             int middleDots = (width / 2) - 1;
  34.             for (int j = 0; j < ((width / 2) - 2) / 2; j++)
  35.             {
  36.                 bottomDots++;
  37.                 middleDots--;
  38.  
  39.                 Console.Write(new string('.', bottomDots));
  40.                 Console.Write('#');
  41.                 Console.Write(new string('.', middleDots));
  42.                 Console.Write(new string('.', middleDots));
  43.                 Console.Write('#');
  44.                 Console.WriteLine(new string('.', bottomDots));
  45.  
  46.             }
  47.             Console.WriteLine(new string('-',width));
  48.             Console.Write(new string('\\', width / 2));
  49.             Console.WriteLine(new string('/',width/2));
  50.  
  51.             int bottomBottomDots = 0;
  52.             int dashes = width / 2 ;
  53.             for (int k = 0; k < width/2 - 1; k++)
  54.             {
  55.                 bottomBottomDots++;
  56.                 dashes--;
  57.                 Console.Write(new string('.', bottomBottomDots));
  58.                 Console.Write(new string('\\', dashes));
  59.                 Console.Write(new string('/', dashes));
  60.                 Console.WriteLine(new string('.', bottomBottomDots));
  61.             }
  62.  
  63.         }
  64.     }
  65.  
  66.     //  12
  67.     //      .....##.....
  68.     //      ....#..#....
  69.     //      ...#....#...
  70.     //      ..#......#..
  71.     //      .#........#.
  72.     //      #..........#
  73.     //      #..........#
  74.     //      .#........#.
  75.     //      ..#......#..
  76.     //      ------------
  77.     //      \\\\\\//////
  78.     //      .\\\\\/////.
  79.     //      ..\\\\////..
  80.     //      ...\\\///...
  81.     //      ....\\//....
  82.     //      .....\/.....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement