Anyone know how to do?
int e,f,g=0;
if(action=='C')
{
/*** Checking whether the square already opened before or not ***/
if (Board[InitPox][InitPoy].open == 0) /* If the square has not been opened yet */
{
Beep(500,200);
printf ("The square is opened! ^^/> \n\n");
/*** Display the number of mine on the square if the square is adjacent to the location of mine ***/
for (e=-1;e<2;e++)
{
for (f=-1;f<2;f++)
{
if (Mines[InitPox + e][InitPoy + f].mine == '*')
{
g++;
}
else
if (Mines[InitPox + e][InitPoy +f].mine == ' ')
for (e=-1;e<2;e++)
{
for (f=-1;f<2;f++)
{
if (Mines[e][f].mine == ' ')
printf("%i",Board[e][f].numMines);
}
}
if(Mines[InitPox][InitPoy].mine == '*')
{
Beep(900,200);
Beep(700,200);
Beep(500,200);
printf ("Boom! Your turtle is dead...\n\n");
printf ("****** Game Over! You Lose ! ******\n");
displayReveal(Board,Mines);
exit (1);
}
}
}
Board[InitPox][InitPoy].numMines = g;
}
if (Board[InitPox][InitPoy].open == 1) /* If the square has been opened before */
{
printf ("The square already opened ! \n\n");
}
Board[InitPox][InitPoy].open = 1;
}
} /* end of ClearSq() */

New Topic/Question
Reply




MultiQuote



|