Chinaunix

标题: 9 Box Game [打印本页]

作者: liuake    时间: 2006-12-11 15:41
标题: 9 Box Game

/***************************************
** 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




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2