Alright, I get the change. My next step is not working, I try to build on an idea, now that I have energySourceAt working.
The following fills the grid with dots, and my TODO is to place * at every energy source. Why don't this work?
// fill the grid with dots
for (r = 0; r < NROWS; r++)
for (c = 0; c < NCOLS; c++)
{
grid[r][c] = '.';
if (energySouceAt(r,c))
grid[r][c] = '*';
}
The red is an error. I'm saying ' if there's an energy source at (r,c)', then replace that dot with a *.