View Single Post
Old Dec 1st, 2006, 12:40 AM   #44
aznballerlee
Hobbyist Programmer
 
Join Date: Nov 2006
Posts: 111
Rep Power: 2 aznballerlee is on a distinguished road
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 *.
aznballerlee is offline   Reply With Quote