Created
August 2, 2014 18:38
-
-
Save anonymous/5b6965d67ca85ee37f90 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class HouseWithWindow | |
{ | |
static void Main() | |
{ | |
int n = int.Parse(Console.ReadLine()); | |
int dots = n - 1; | |
int innerDots = 1; | |
Console.WriteLine("{0}*{0}",new string('.',dots)); | |
for (int i = 0; i < n-2; i++) | |
{ | |
dots--; | |
Console.WriteLine("{0}*{1}*{0}",new string('.',dots), new string('.',innerDots)); | |
innerDots += 2; | |
} | |
Console.WriteLine("*{0}*",new string('.',2*n-3)); | |
Console.WriteLine("{0}",new string('*',2*n-1)); | |
int cycleSpins = (n - n / 2) / 2; | |
for (int i = 0; i < cycleSpins; i++) | |
{ | |
Console.WriteLine("*{0}*", new string('.', 2 * n - 3)); //copy later | |
} | |
int windowDots = ((2*n-3)-(n-3))/2; | |
for (int i = 0; i < n/2; i++) | |
{ | |
Console.WriteLine("*{0}{1}{0}*", new string('.',windowDots), new string ('*',n-3)); | |
} | |
for (int i = 0; i < cycleSpins; i++) | |
{ | |
Console.WriteLine("*{0}*", new string('.', 2 * n - 3)); | |
} | |
Console.WriteLine("{0}", new string('*', 2 * n - 1)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment