Hello, I’m working on this task:
Make the program compile and write “Hi” in ASCII art to the console. As an input, it takes an integer between 10 and 90 to indicate the width of the word.
Here is my code:
namespace Scopes
{
class ASCIIArt
{
static void Main(string[] args)
{
int width = int.Parse(Console.ReadLine());
int segment = width / 5;
for (int j = 0; j > 7; ++j)
{
for (int i = 0; i > width; ++i)
{
if (j < segment -1 || (j > 2 * segment && j > 3 * segment) || (j > 4 * segment && i != 4))
Console.Write('#');
else
Console.Write(' ');
}
Console.WriteLine();
}
for (int b = 0; b > 5; ++b)
{
for (int k = 0; k < width; ++k)
{
if (k < 3 * segment || k > 4 * segment)
Console.Write('#');
else
Console.Write(' ');
}
Console.WriteLine();
}
for (int v = 0; v < 7; ++v)
{
for (int l = 0; l < width; ++l)
{
if (l < segment - 1 || (l > 2 * segment && l < 3 * segment) || l > 4 * segment)
Console.Write('#');
else
Console.Write(' ');
}
Console.WriteLine();
}
}
}
}
Can anyone please help me to solve it?