Advertisement
Guest User

Axe

a guest
Nov 1st, 2016
969
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 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 Drawing_Axe
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var n = int.Parse(Console.ReadLine());
  14. var mid = 0;
  15. var back = (5 * n) - (3 * n)- (2*mid);
  16. var front = 3 * n;
  17.  
  18. // Part 1
  19. for (int row = 1; row <= n ; row++)
  20. {
  21. Console.WriteLine("{0}*{1}*{2}", new string('-',front), new string('-', mid++), new string('-',back-=2 ));
  22. back++;
  23. }
  24. //Part 2
  25. for (int row2 = 1; row2 <= n/2; row2 ++)
  26. {
  27. Console.WriteLine("{0}*{1}*{2}",new string('*',front), new string('-',mid = n-1), new string('-',back=mid));
  28. }
  29. //Part 3
  30. for (int row3 = 1; row3 <= n/2-1; row3++)
  31. {
  32.  
  33.  
  34. if (n % 5 == 1)
  35. {
  36. Console.WriteLine("{0}*{1}*{2}", new string('-', front), new string('-', mid = n - 1), new string('-', back = mid));
  37. }
  38. else
  39. {
  40.  
  41. Console.WriteLine("{0}*{1}*{2}", new string('-', (front)), new string('-', mid ), new string('-', back --));
  42. front--;
  43. mid +=2;
  44.  
  45. }
  46.  
  47.  
  48. }
  49.  
  50. //TODO LAST ROW :((
  51. }
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement