Hello,
Reading the C# players guide (Great book BTW!), I have come up with a nested loop that is a bit different to the solution on the C# tutorials here on the website.
Just wondering if there would be a preference as to which one is better in terms of readability and commonality. (If I should be setting up my loops as per the solution on the website instead, if that is a more common way of doing things).
static void Main(string[] args)
{
for (int row = 0; row < 5; row++)
{
for (int spaces = 5; spaces > row; spaces--)
{
Console.Write(" ");
}
for (int column = 0; column <= row * 2; column++)
{
Console.Write("*");
}
Console.WriteLine();
}
Console.ReadKey();
}