- 论坛徽章:
- 0
|
/***************************************
** filename: 9box.c
** -------------------------------------
** fucntion: 一个游戏的程序解决。看得懂的自己看吧
****************************************
#include
short box[9][9];
char flag[9][9];
void init_box();
void output_result();
short check(short, short, short);
int main(void)
{
short i, j, k;
short backforward = 0;
short forward = 0;
init_box();
output_result();
for (i=0; i=0; )
{
if (backforward)
{
j = 8;
}
else
{
j = 0;
}
/* search for this column */
for (; j=0;)
{
if (flag[j] != 1) /* not static value */
{
if (backforward) backforward = 0; /* cls, forward now */
for (k=box[j]+1; k
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/28158/showart_213412.html |
|