simonradev

Fox

Mar 11th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.82 KB | None | 0 0
  1. namespace Fox
  2. {
  3.     using System;
  4.  
  5.     public class Fox
  6.     {
  7.         public static void Main()
  8.         {
  9.             int foxSize = int.Parse(Console.ReadLine());
  10.  
  11.             //printing the top part of the fox (ears)
  12.             int betweenEarsDashes = (foxSize * 2) - 1;
  13.             for (int currRow = 1; currRow <= foxSize; currRow++)
  14.             {
  15.                 Console.Write(new string('*', currRow));
  16.                 Console.Write('\\');
  17.                 Console.Write(new string('-', betweenEarsDashes));
  18.                 Console.Write('/');
  19.                 Console.WriteLine(new string('*', currRow));
  20.  
  21.                 betweenEarsDashes -= 2;
  22.             }
  23.  
  24.             //printing the middle row
  25.             int middleRows = foxSize / 3;
  26.  
  27.             int leftAndRightAst = foxSize / 2;
  28.             int middleAst = foxSize;
  29.             for (int currRow = 0; currRow < middleRows; currRow++)
  30.             {
  31.                 Console.Write('|');
  32.                 Console.Write(new string('*', leftAndRightAst + currRow));
  33.                 Console.Write('\\');
  34.                 Console.Write(new string('*', middleAst));
  35.                 Console.Write('/');
  36.                 Console.Write(new string('*', leftAndRightAst + currRow));
  37.                 Console.WriteLine('|');
  38.  
  39.                 middleAst -= 2;
  40.             }
  41.  
  42.             //printing the bot row
  43.             int astInBotPart = (foxSize * 2) - 1;
  44.             for (int currRow = 1; currRow <= foxSize; currRow++)
  45.             {
  46.                 Console.Write(new string('-', currRow));
  47.                 Console.Write('\\');
  48.                 Console.Write(new string('*', astInBotPart));
  49.                 Console.Write('/');
  50.                 Console.WriteLine(new string('-', currRow));
  51.  
  52.                 astInBotPart -= 2;
  53.             }
  54.         }
  55.     }
  56. }
Add Comment
Please, Sign In to add comment