View Single Post
Old 01-07-2006, 10:20 AM   #36
Abi79
Home Sweet Abandonia

 
Join Date: May 2005
Location: Oradea, Romania
Posts: 829
Send a message via Yahoo to Abi79
Default

There's a small lil' problem...or maybe two problems.

1. Even if I've saved the file as a *.c, when I tried to run it in BorlandC++ for DOS, I got the following error message:
"Lvalue required" at
Code:
: bd[s.x + d * step.x][s.y + d * step.y].pship = c + 1;
I've fixed this (added another = before c + 1) and then I've started the game.

Setup: auto
At the fleet screen, I couldn't see any of my ships. I've ignored that and chosed to attack c5. Of course I missed (I always lose in games :P ), and the computer started it's turn. But nothing happened. Following the using of the ingenious key combo CTRL+Break, I managed to see that the computer entered a loop.

Code:
int hit_no_sink (int x, int y) {
**if (bd[x][y].chit)**// bd[x][y].chit=0
//*skips rest of code*
**return 0;
}
Then it goes to
Code:
if (hit_no_sink (c.x,c.y)) {** 
/*starts hit_no_sink and does the same thing as above; it doesn't go further because hit_no_sink always returns 0*/
For Setup: manual the computer does the same thing, after I finish choosing the locations of my ships and he starts his turn.

What might cause the problem?
Abi79 is offline                         Send a private message to Abi79
Reply With Quote