Original Post
hey. I havent programmed for quite a bit of time. Just getting back into it. Ive decided to try to replicate the minesweeper flags game that you can play in msn using openGL. ive started off making a class for the squares on the board: class square{ public: int type; // 0 = BLANK; 1-8 = NUMBERED; 9 = FLAG; int visible; square() { assign(0, 0); } void assign(char squareType, int squareVisible); }; void square::assign(char squareType, int squareVisible){ type = squareType; visible = squareVisible; } I then created a function for randomly picking a set amount of squares across the board to be flags. With the following header. void generateFlags(square gameFlag[BOARD_WIDTH][BOARD_HEIGHT]){ // blah blah blah } Finally there is a function to set the values for all of the other squares. If you are familiar with the game you will know that each square that is not a flag contains a number. The number being the amount of flags that directly surround that square. void setOtherSquares(square gameFlag[BOARD_WIDTH][BOARD_HEIGHT]){ // blah blah blah } Is this the best way to go about this problem? Would it be better to create another class for the board? Also I want to have something like the following: square gameFlag[BOARD_WIDTH][BOARD_HEIGHT]; // the squares on the board generateFlags(gameFlag); setOtherSquares(gameFlag); The here problem is that i want to pass the gameFlag object into the functions as a reference. So that the functions directly alter the contents of the object but when i try to do this the compiler complains about not being able to reference arrays. Can anyone help me with a solution? Cheers Benen