Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Eggcelent
- {
- class Eggcelent
- {
- static void Main()
- {
- int N = Int32.Parse(Console.ReadLine());
- int stars = N - 1;
- int drawingArea = (3 * N) + 1;
- int vertical = (N / 2) - 2;
- int height = N - (2 + vertical);
- int dotsEnd = (drawingArea - stars) / 2;
- int dotsMiddle = N + 1;
- //first line of egg
- Console.Write(new string('.', dotsEnd));
- Console.Write(new string('*', stars));
- Console.Write(new string('.', dotsEnd));
- Console.WriteLine();
- //the lines below the first line
- dotsEnd -= 2;
- for (int i = 0; i < height; i++)
- {
- Console.Write(new string('.', dotsEnd));
- Console.Write('*');
- Console.Write(new string('.', dotsMiddle));
- Console.Write('*');
- Console.Write(new string('.', dotsEnd));
- Console.WriteLine();
- dotsEnd -= 2;
- dotsMiddle += 4;
- }
- //loop for the line(s) just above the monkey symbols with 1 dotsEnd
- dotsMiddle = drawingArea - 4;
- for (int i = 0; i < vertical; i++)
- {
- Console.Write('.');
- Console.Write('*');
- Console.Write(new string('.', dotsMiddle));
- Console.Write('*');
- Console.Write('.');
- Console.WriteLine();
- }
- //the two lines with monkey symbols
- int monkeyCounter = 2;
- Console.Write('.');
- Console.Write('*');
- //first line of monkey symbols
- for (int i = 0; i < (drawingArea - 4); i++)
- {
- if (monkeyCounter % 2 == 0)
- {
- Console.Write('@');
- }
- else
- {
- Console.Write('.');
- }
- monkeyCounter++;
- }
- Console.Write('*');
- Console.Write('.');
- Console.WriteLine();
- //second line of monkey symbols
- monkeyCounter = 2;
- Console.Write('.');
- Console.Write('*');
- for (int i = 0; i < (drawingArea - 4); i++)
- {
- if (monkeyCounter % 2 == 0)
- {
- Console.Write('.');
- }
- else
- {
- Console.Write('@');
- }
- monkeyCounter++;
- }
- Console.Write('*');
- Console.Write('.');
- Console.WriteLine();
- //loop for the line(s) just below the monkey symbols with 1 dotsEnd
- dotsMiddle = drawingArea - 4;
- for (int i = 0; i < vertical; i++)
- {
- Console.Write('.');
- Console.Write('*');
- Console.Write(new string('.', dotsMiddle));
- Console.Write('*');
- Console.Write('.');
- Console.WriteLine();
- }
- //main part of the bottom of the egg
- dotsEnd = 1;
- dotsMiddle = drawingArea - 4;
- for (int i = 0; i < height; i++)
- {
- Console.Write(new string('.', dotsEnd));
- Console.Write('*');
- Console.Write(new string('.', dotsMiddle));
- Console.Write('*');
- Console.Write(new string('.', dotsEnd));
- Console.WriteLine();
- dotsEnd += 2;
- dotsMiddle -= 4;
- }
- //the last line
- dotsEnd = (drawingArea - stars) / 2;
- Console.Write(new string('.', dotsEnd));
- Console.Write(new string('*', stars));
- Console.Write(new string('.', dotsEnd));
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement