October 30th, 2003, 02:41 AM
Need Some C++ Help
Well, I suppose I will give this forum it's first thread.
Im working on a program for a school assignment.
It's not too advanced. It compiles just fine. Im just getting a logic error.
The program is a game, played between you and the computer. Players
alternate turns putting down pieces randomly till they get five in a row
in either direction.
Most of this hasn't been implimented yet. Here is what has...
After Running TestGame you are prompted to enter if you want to be b or w.
Enter either b or w then the game displays a board of empty spaces (0's)
Then it asks you to enter a char/int combo. So enter something like a2
From there, the data is entered into the board, and your letter (b or w) is in place of the zero.
The problem is, when I print the board for the second time, all that shows up is zeros.
I know the data is actually being put into the board becasuse I have called the data at the location in the array specifically and it has shown that it is there. I think my problem is in BoardClass.cpp in the function PrintBoard. And Im sure the problem is with the for statements.
I just can't figure out why the board keeps printing a "blank" board. Any help would be nice.
The file is attached.