simonradev

Stop sign

Oct 10th, 2016
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.39 KB | None | 0 0
  1. using System;
  2.  
  3. namespace StopSign
  4. {
  5.     class Program
  6.     {
  7.         public static void Main(string[] args)
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.            
  11.             int topDots = (n + 1);
  12.             int topDashes = (n * 2 - 1);
  13.             int topDashesIncrease = (topDashes - 2);
  14.             int botDotsLeft = -1;
  15.             int botDotsRight = -1;
  16.             int botPartDashes = (n * 4 - 1);
  17.             int botPartDashesDecrease = (botPartDashes + 2);
  18.             string topRow = new String('.', topDots) + new String('_', (topDashes + 2)) + new String('.', topDots);
  19.             string middleSTOP = "//" + new String('_', (n * 2 - 3)) + "STOP!" + new String('_', (n * 2 - 3)) + "\\\\";
  20.            
  21.             //top part of the STOP sign
  22.             Console.WriteLine(topRow);
  23.             for (int currentRow = 0; currentRow < n; currentRow++)
  24.             {
  25.                 Console.Write(new String('.', (n - currentRow)));
  26.                 Console.Write("//");
  27.                 Console.Write(new String('_', (topDashesIncrease += 2)));
  28.                 Console.Write("\\\\");
  29.                 Console.Write(new String('.', (n - currentRow)));
  30.                 Console.WriteLine();
  31.             }          
  32.             Console.WriteLine(middleSTOP);
  33.            
  34.             //bot part of the STOP sign
  35.             for (int currentRow = n; currentRow > 0; currentRow--)
  36.             {
  37.                 Console.Write(new String('.', botDotsLeft += 1));
  38.                 Console.Write("\\\\");
  39.                 Console.Write(new String('_', botPartDashesDecrease -= 2));
  40.                 Console.Write("//");
  41.                 Console.Write(new String('.', botDotsRight += 1));
  42.                 Console.WriteLine();
  43.             }
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment