Problem with my CGOL

I've been working on implementing Conway's Game of Life in C++. Unfortunately, I have run into a problem. When I try to move the camera, I scroll 2 spaces instead of 1. I think that my problem is somewhere within my print function:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
void print_board(const life::board& outboard, WINDOW* menu)
{
        wclear(menu);
	for (int i=outboard.cam_y(); i>-1*outboard.cam_height() + outboard.cam_y(); i--)
	{
		for (int j=outboard.cam_x(); j<outboard.cam_x() + outboard.cam_width(); j++)
                {
		    if (outboard.at(j, i) == true)
                    {
                        wprintw(menu, "x ");
                    }
                    else
                    {
                        wprintw(menu, "- ");
                    }
		}
		wprintw(menu, "\n");
	}
	wrefresh(menu);
}


Can you see a problem with the code here? Have I left something out? Or is the problem somewhere else?
Topic archived. No new replies allowed.