From: Neil R. <ne...@co...> - 2003-07-23 16:11:26
|
Jeremy Jansma wrote: > // added this loop and my GRY gets screwed up > for(int col2 = 0; col2 <= 22; col2++) > game_grid[21][col2] = 1; > Follow that loop, what happens when col2 equals 22? ;) Your program will attempt to set game_grid[21][22] = 1; And since there IS only zero to 21, 22 will be the memory location just 1 beyond that variable, how much do you want to bed that is where your grey colour variable is being stored? Either way, change that line to: for(int col2 = 0; col2 < 22; col2++) -- Neil Roy - http://home.cogeco.ca/~nroy15 "My religion consists of a humble admiration of the illimitable superior spirit who reveals himself in the slight details we are able to perceive with our frail and feeble mind." - Albert Einstein |