Why doesn't this work?

I added code below the single line in the for loop:
if (spaceX == i && mountainH == spaceY -1 && mountainH != 0)
{
Console.WriteLine(“Fire”);
}
else
{
Console.WriteLine(“Hold”);
}

why doesn’t it do the job?

Because, having put your code in a loop of 8 steps, you are guaranteed to output 8 orders per turns, which is obviously 7 too many.

1 Like

use the appropriate topic