Skip to content

Instantly share code, notes, and snippets.

@boyanov83
Created July 26, 2014 19:15
Show Gist options
  • Save boyanov83/870fc39797cc611d9018 to your computer and use it in GitHub Desktop.
Save boyanov83/870fc39797cc611d9018 to your computer and use it in GitHub Desktop.
using System;
class TheExplorer
{
static void Main()
{
int n = int.Parse(Console.ReadLine());
int outerDashes = 0;
int innerDashes = 1;
int lowerOuterDashes = 1;
int lowerInnerDashes = n-4;
Console.WriteLine("{0}*{0}", new string('-', (n - 1) / 2));
for (int i = 0; i < (n-3)/2; i++)
{
outerDashes = (n - 2 - innerDashes)/2;
Console.WriteLine("{0}*{1}*{0}", new string('-', outerDashes), new string('-', innerDashes));
innerDashes += 2;
}
Console.WriteLine("*{0}*",new string('-', n-2));
for (int i = 0; i < (n-3)/2; i++)
{
lowerOuterDashes = (n-2-lowerInnerDashes)/2;
Console.WriteLine("{0}*{1}*{0}", new string('-', lowerOuterDashes), new string('-', lowerInnerDashes));
lowerInnerDashes -= 2;
}
Console.WriteLine("{0}*{0}", new string('-', (n - 1) / 2));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment