回 帖 发 新 帖 刷新版面

主题:我很早以前编的五子棋,供大家参考!

需要一些我自己定义的*.h文件,有兴趣的话我可以贴上来
#include "stdio.h"
#include "conio.h"
#include "stdlib.h"
#include "string.h"
#include "graphics.h"
#include "bioskey.h"
#include "mousea.h"

int oldi,oldj,f=1;
again()
{
    int x,y;
    setlinestyle(0,0,3);
    setfillstyle(1,7);
    bar(100,150,400,300);
    setcolor(15);
    line(100,150,400,150);
    line(100,150,100,300);
    setcolor(4);
    line(100,300,400,300);
    line(400,150,400,300);
    settextstyle(1,0,2);
    outtextxy(170,170,"Play again?");
    outtextxy(170,230,"OK");
    outtextxy(300,230,"NO");
    initmouse();
    showmouse();
    while(1)
    {
        getmousexy(&x,&y);
        if(x>120&&x<240&&y>210&&y<270)
        {
            setcolor(15);
            line(130,210,230,210);
            line(130,210,130,270);
            setcolor(0);
            line(130,270,230,270);
            line(230,210,230,270);
            if(getpressinfo(0)==1)
            {
                    hidemouse();
                    main();
            }
            continue;
        }
        if(x>260&&x<380&&y>210&&y<270)
        {
            setcolor(15);
            line(270,210,370,210);
            line(270,210,270,270);
            setcolor(0);
            line(270,270,370,270);
            line(370,210,370,270);
            if(getpressinfo(0)==1)
            {
                hidemouse();
                closegraph();
            }
            continue;
        }
        if(!(x>120&&x<240&&y>210&&y<270&&x>260&&x<380&&y>210&&y<270))
        {
            setcolor(7);
            line(130,210,230,210);
            line(130,210,130,270);
            line(130,270,230,270);
            line(230,210,230,270);
            line(270,210,370,210);
            line(270,210,270,270);
            line(270,270,370,270);
            line(370,210,370,270);
            if(getpressinfo(0)==1);
            continue;
        }
    }
}
win1(int i)
{
    setcolor(3);
    settextstyle(1,0,4);
    outtextxy(100,10,"Press any key!");
    settextstyle(1,0,6);
    randomize();
    if(i==1)
    {
        while(!bioskey(1))
        {
            setcolor(random(15)+1);
            outtextxy(100,400,"PLAY_1 IS WINNER");
            delay(50);
        }
        again();
    }
    if(i==2)
    {
        while(!bioskey(1))
        {
            setcolor(random(15)+1);
            outtextxy(100,400,"PLAY_2 IS WINNER");
            delay(50);
        }
        again();
    }
}

panduan(int a[16][16],int x,int y,int iflag)
{
    if(a[x][y]==iflag)
        if( (a[x+1][y]==iflag&&a[x+2][y]==iflag&&a[x+3][y]==iflag&&a[x+4][y]==iflag)
          ||(a[x-1][y]==iflag&&a[x+1][y]==iflag&&a[x+2][y]==iflag&&a[x+3][y]==iflag)
          ||(a[x-2][y]==iflag&&a[x-1][y]==iflag&&a[x+1][y]==iflag&&a[x+2][y]==iflag)
          ||(a[x-3][y]==iflag&&a[x-2][y]==iflag&&a[x-1][y]==iflag&&a[x+1][y]==iflag)
          ||(a[x-4][y]==iflag&&a[x-3][y]==iflag&&a[x-2][y]==iflag&&a[x-1][y]==iflag))
            win1(iflag);
        if( (a[x+1][y+1]==iflag&&a[x+2][y+2]==iflag&&a[x+3][y+3]==iflag&&a[x+4][y+4]==iflag)
          ||(a[x-1][y-1]==iflag&&a[x+1][y+1]==iflag&&a[x+2][y+2]==iflag&&a[x+3][y+3]==iflag)
          ||(a[x-2][y-2]==iflag&&a[x-1][y-1]==iflag&&a[x+1][y+1]==iflag&&a[x+2][y+2]==iflag)
          ||(a[x-3][y-3]==iflag&&a[x-2][y-2]==iflag&&a[x-1][y-1]==iflag&&a[x+1][y+1]==iflag)
          ||(a[x-4][y-4]==iflag&&a[x-3][y-3]==iflag&&a[x-2][y-2]==iflag&&a[x-1][y-1]==iflag))
            win1(iflag);
        if( (a[x][y+1]==iflag&&a[x][y+2]==iflag&&a[x][y+3]==iflag&&a[x][y+4]==iflag)
          ||(a[x][y-1]==iflag&&a[x][y+1]==iflag&&a[x][y+2]==iflag&&a[x][y+3]==iflag)
          ||(a[x][y-2]==iflag&&a[x][y-1]==iflag&&a[x][y+1]==iflag&&a[x][y+2]==iflag)
          ||(a[x][y-3]==iflag&&a[x][y-2]==iflag&&a[x][y-1]==iflag&&a[x][y+1]==iflag)
          ||(a[x][y-4]==iflag&&a[x][y-3]==iflag&&a[x][y-2]==iflag&&a[x][y-1]==iflag))
            win1(iflag);
        if( (a[x+1][y-1]==iflag&&a[x+2][y-2]==iflag&&a[x+3][y-3]==iflag&&a[x+4][y-4]==iflag)
          ||(a[x-1][y+1]==iflag&&a[x+1][y-1]==iflag&&a[x+2][y-2]==iflag&&a[x+3][y-3]==iflag)
          ||(a[x-2][y+2]==iflag&&a[x-1][y+1]==iflag&&a[x+1][y-1]==iflag&&a[x+2][y-2]==iflag)
          ||(a[x-3][y+3]==iflag&&a[x-2][y+2]==iflag&&a[x-1][y+1]==iflag&&a[x+1][y-1]==iflag)
          ||(a[x-4][y+4]==iflag&&a[x-3][y+3]==iflag&&a[x-2][y+2]==iflag&&a[x-1][y+1]==iflag))
            win1(iflag);
}

putchess(int a[16][16])
{
    int k,l,x=0,y=0;
    f++;
    for(k=0;k<16;k++)
        for(l=0;l<16;l++)
        {
            if(a[k][l]==1)
            {
                x=k*20;
                y=l*20;
                setlinestyle(0,0,1);
                setcolor(14);
                qizi(x+50,y+50,14);
//                a[k][l]==1;
                oldi=k;
                oldj=l;
//                printf("%d %d",&k,&l);
                panduan(a,k,l,1);
            }
            if(a[k][l]==4)
            {
                x=k*20;
                y=l*20;
                setlinestyle(0,0,1);
                setcolor(4);
                qizi(x+50,y+50,4);
                a[k][l]=2;
                panduan(a,k,l,2);
            }
        }
}

qizi(int x,int y,int i)
{
    circle(x,y,6);
    setfillstyle(1,i-1);
    floodfill(x,y,i);
}

judg4_1(int a[16][16],int newi,int newj,int num1,int num2)
{
            if(a[newi][newj]==num2&&a[newi-1][newj]==num2&&a[newi-2][newj]==num2&&a[newi-3][newj]==num2)
            {
                if(a[newi+1][newj]==0)
                {
                    a[newi+1][newj]=num1;
                    putchess(a);
                    return 5;
                }
                if(a[newi-4][newj]==0)
                {
                    a[newi-4][newj]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2 && a[newi-1][newj]==num2 && a[newi-2][newj]==num2 && a[newi+1][newj]==num2)
            {
                if(a[newi-3][newj]==0)
                {
                    a[newi-3][newj]=num1;
                    putchess(a);
                    return 5;
                }
                if(a[newi+2][newj]==0)
                {
                    a[newi+2][newj]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2 && a[newi-1][newj]==num2 && a[newi+1][newj]==num2 && a[newi+2][newj]==num2)
            {
                if(a[newi-2][newj]==0)
                {
                    a[newi-2][newj]=num1;
                    putchess(a);
                    return 5;
                }
                if(a[newi+3][newj]==0)
                {
                    a[newi+3][newj]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2 && a[newi+1][newj]==num2 && a[newi+2][newj]==num2 && a[newi+3][newj]==num2)
            {
                if(a[newi-1][newj]==0)
                {
                    a[newi-1][newj]=num1;
                    putchess(a);
                    return 5;
                }
                if(a[newi+4][newj]==0)
                {
                    a[newi+4][newj]=num1;
                    putchess(a);
                    return 5;
                }
            }


            if(a[newi-4][newj]==num2&&a[newi-3][newj]==num2&&a[newi-1][newj]==num2&&a[newi][newj]==num2)
            {
                if(a[newi-2][newj]==0)
                {
                    a[newi-2][newj]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi-3][newj]==num2&&a[newi-2][newj]==num2&&a[newi+1][newj]==num2&&a[newi][newj]==num2)
            {
                if(a[newi-1][newj]==0)
                {
                    a[newi-1][newj]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi-1][newj]==num2&&a[newi][newj]==num2&&a[newi+2][newj]==num2&&a[newi+3][newj]==num2)
            {
                if(a[newi+1][newj]==0)
                {
                    a[newi+1][newj]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2&&a[newi+1][newj]==num2&&a[newi+3][newj]==num2&&a[newi+4][newj]==num2) //8
            {
                if(a[newi+2][newj]==0)
                {
                    a[newi+2][newj]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2&&a[newi-2][newj]==num2&&a[newi-3][newj]==num2&&a[newi-4][newj]==num2)
            {
                if(a[newi-1][newj]==0)
                {
                    a[newi-1][newj]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2&&a[newi-2][newj]==num2&&a[newi+1][newj]==num2&&a[newi+2][newj]==num2)
            {
                if(a[newi-1][newj]==0)
                {
                    a[newi-1][newj]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2&&a[newi+2][newj]==num2&&a[newi+3][newj]==num2&&a[newi+4][newj]==num2)
            {
                if(a[newi+1][newj]==0)
                {
                    a[newi+1][newj]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2&&a[newi-1][newj]==num2&&a[newi-2][newj]==num2&&a[newi+2][newj]==num2)
            {
                if(a[newi+1][newj]==0)
                {
                    a[newi+1][newj]=num1;
                    putchess(a);
                    return 5;
                }
            }

           //heng lian 4

            if(a[newi][newj]==num2 && a[newi-1][newj-1]==num2 && a[newi-2][newj-2]==num2 && a[newi-3][newj-3]==num2)
            {
                if(a[newi+1][newj+1]==0)
                {
                    a[newi+1][newj+1]=num1;
                    putchess(a);
                    return 5;
                }
                if(a[newi-4][newj-4]==0)
                {
                    a[newi-4][newj-4]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2 && a[newi-1][newj-1]==num2 && a[newi-2][newj-2]==num2 && a[newi+1][newj+1]==num2)
            {
                if(a[newi-3][newj-3]==0)
                {
                    a[newi-3][newj-3]=num1;
                    putchess(a);
                    return 5;
                }
                if(a[newi+2][newj+2]==0)
                {
                    a[newi+2][newj+2]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2 && a[newi-1][newj-1]==num2 && a[newi+1][newj+1]==num2 && a[newi+2][newj+2]==num2)
            {
                if(a[newi-2][newj-2]==0)
                {
                    a[newi-2][newj-2]=num1;
                    putchess(a);
                    return 5;
                }
                if(a[newi+3][newj+3]==0)
                {
                    a[newi+3][newj+3]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2 && a[newi+1][newj+1]==num2 && a[newi+2][newj+1]==num2 && a[newi+3][newj+3]==num2)
            {
                if(a[newi-1][newj-1]==0)
                {
                    a[newi-1][newj-1]=num1;
                    putchess(a);
                    return 5;
                }
                if(a[newi+4][newj+4]==0)
                {
                    a[newi+4][newj+4]=num1;
                    putchess(a);
                    return 5;
                }
            }


            if(a[newi-4][newj-4]==num2&&a[newi-3][newj-3]==num2&&a[newi-1][newj-1]==num2&&a[newi][newj]==num2)
            {
                if(a[newi-2][newj-2]==0)
                {
                    a[newi-2][newj-2]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi-3][newj-3]==num2&&a[newi-2][newj-2]==num2&&a[newi+1][newj+1]==num2&&a[newi][newj]==num2)
            {
                if(a[newi-1][newj-1]==0)
                {
                    a[newi-1][newj-1]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi-1][newj-1]==num2&&a[newi][newj]==num2&&a[newi+2][newj+2]==num2&&a[newi+3][newj+3]==num2)
            {
                if(a[newi+1][newj+1]==0)
                {
                    a[newi+1][newj+1]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2&&a[newi+1][newj+1]==num2&&a[newi+3][newj+3]==num2&&a[newi+4][newj+4]==num2)
            {
                if(a[newi+2][newj+2]==0)
                {
                    a[newi+2][newj+2]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2&&a[newi-2][newj-2]==num2&&a[newi-3][newj-3]==num2&&a[newi-4][newj-4]==num2)
            {
                if(a[newi-1][newj-1]==0)
                {
                    a[newi-1][newj-1]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2&&a[newi-2][newj-2]==num2&&a[newi+1][newj+1]==num2&&a[newi+2][newj+2]==num2)
            {
                if(a[newi-1][newj-1]==0)
                {
                    a[newi-1][newj-1]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2&&a[newi+2][newj+2]==num2&&a[newi+3][newj+3]==num2&&a[newi+4][newj+4]==num2)
            {
                if(a[newi+1][newj+1]==0)
                {
                    a[newi+1][newj+1]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2&&a[newi-1][newj-1]==num2&&a[newi-2][newj-2]==num2&&a[newi+2][newj+2]==num2)
            {
                if(a[newi+1][newj+1]==0)
                {
                    a[newi+1][newj+1]=num1;
                    putchess(a);
                    return 5;
                }
            }

            //you xie lian 4

            if(a[newi][newj]==num2 && a[newi][newj-1]==num2 && a[newi][newj-2]==num2 && a[newi][newj-3]==num2)
            {
                if(a[newi][newj+1]==0)
                {
                    a[newi][newj+1]=num1;
                    putchess(a);
                    return 5;
                }
                if(a[newi][newj-4]==0)
                {
                    a[newi][newj-4]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2 && a[newi][newj-1]==num2 && a[newi][newj-2]==num2 && a[newi][newj+1]==num2)
            {
                if(a[newi][newj-3]==0)
                {
                    a[newi][newj-3]=num1;
                    putchess(a);
                    return 5;
                }
                if(a[newi][newj+2]==0)
                {
                    a[newi][newj+2]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2 && a[newi][newj-1]==num2 && a[newi][newj+1]==num2 && a[newi][newj+2]==num2)
            {
                if(a[newi][newj-2]==0)
                {
                    a[newi][newj-2]=num1;
                    putchess(a);
                    return 5;
                }
                if(a[newi][newj+3]==0)
                {
                    a[newi][newj+3]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2 && a[newi][newj+1]==num2 && a[newi][newj+2]==num2 && a[newi][newj+3]==num2)
            {
                if(a[newi][newj-1]==0)
                {
                    a[newi][newj-1]=num1;
                    putchess(a);
                    return 5;
                }
                if(a[newi][newj+4]==0)
                {
                    a[newi][newj+4]=num1;
                    putchess(a);
                    return 5;
                }
            }


            if(a[newi][newj-4]==num2&&a[newi][newj-3]==num2&&a[newi][newj-1]==num2&&a[newi][newj]==num2)
            {
                if(a[newi][newj-2]==0)
                {
                    a[newi][newj-2]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj-3]==num2&&a[newi][newj-2]==num2&&a[newi][newj+1]==num2&&a[newi][newj]==num2)
            {
                if(a[newi][newj-1]==0)
                {
                    a[newi][newj-1]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj-1]==num2&&a[newi][newj]==num2&&a[newi][newj+2]==num2&&a[newi][newj+3]==num2)
            {
                if(a[newi][newj+1]==0)
                {
                    a[newi][newj+1]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2&&a[newi][newj+1]==num2&&a[newi][newj+3]==num2&&a[newi][newj+4]==num2)
            {
                if(a[newi][newj+2]==0)
                {
                    a[newi][newj+2]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2&&a[newi][newj-2]==num2&&a[newi][newj-3]==num2&&a[newi][newj-4]==num2)
            {
                if(a[newi][newj-1]==0)
                {
                    a[newi][newj-1]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2&&a[newi][newj-2]==num2&&a[newi][newj+1]==num2&&a[newi][newj+2]==num2)
            {
                if(a[newi][newj-1]==0)
                {
                    a[newi][newj-1]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2&&a[newi][newj+2]==num2&&a[newi][newj+3]==num2&&a[newi][newj+4]==num2)
            {
                if(a[newi][newj+1]==0)
                {
                    a[newi][newj+1]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2&&a[newi][newj-1]==num2&&a[newi][newj-2]==num2&&a[newi][newj+2]==num2)
            {
                if(a[newi][newj+1]==0)
                {
                    a[newi][newj+1]=num1;
                    putchess(a);
                    return 5;
                }
            }

            //shu lian 4


            if(a[newi][newj]==num2 && a[newi-1][newj+1]==num2 && a[newi-2][newj+2]==num2 && a[newi-3][newj+3]==num2)//1
            {
                if(a[newi+1][newj-1]==0)
                {
                    a[newi+1][newj-1]=num1;
                    putchess(a);
                    return 5;
                }
                if(a[newi-4][newj+4]==0)
                {
                    a[newi-4][newj+4]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2 && a[newi-1][newj+1]==num2 && a[newi-2][newj+2]==num2 && a[newi+1][newj-1]==num2)//2
            {
                if(a[newi-3][newj+3]==0)
                {
                    a[newi-3][newj-3]=num1;
                    putchess(a);
                    return 5;
                }
                if(a[newi+2][newj-2]==0)
                {
                    a[newi+2][newj-2]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2 && a[newi-1][newj+1]==num2 && a[newi+1][newj-1]==num2 && a[newi+2][newj-2]==num2)//3
            {
                if(a[newi-2][newj+2]==0)
                {
                    a[newi-2][newj+2]=num1;
                    putchess(a);
                    return 5;
                }
                if(a[newi+3][newj-3]==0)
                {
                    a[newi+3][newj-3]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2 && a[newi+1][newj-1]==num2 && a[newi+2][newj-1]==num2 && a[newi+3][newj-3]==num2)//4
            {
                if(a[newi-1][newj+1]==0)
                {
                    a[newi-1][newj+1]=num1;
                    putchess(a);
                    return 5;
                }
                if(a[newi+4][newj-4]==0)
                {
                    a[newi+4][newj-4]=num1;
                    putchess(a);
                    return 5;
                }
            }


            if(a[newi-4][newj+4]==num2&&a[newi-3][newj+3]==num2&&a[newi-1][newj+1]==num2&&a[newi][newj]==num2)   //5
            {
                if(a[newi-2][newj+2]==0)
                {
                    a[newi-2][newj+2]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi-3][newj+3]==num2&&a[newi-2][newj+2]==num2&&a[newi+1][newj-1]==num2&&a[newi][newj]==num2)   //6
            {
                if(a[newi-1][newj+1]==0)
                {
                    a[newi-1][newj+1]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi-1][newj+1]==num2&&a[newi][newj]==num2&&a[newi+2][newj-2]==num2&&a[newi+3][newj-3]==num2)//7
            {
                if(a[newi+1][newj-1]==0)
                {
                    a[newi+1][newj-1]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2&&a[newi+1][newj-1]==num2&&a[newi+3][newj-3]==num2&&a[newi+4][newj-4]==num2)//8
            {
                if(a[newi+2][newj-2]==0)
                {
                    a[newi+2][newj-2]=num1;
                    putchess(a);
                    return 5;
                }
            }

            if(a[newi][newj]==num2&&a[newi+2][newj-2]==num2&&a[newi+3][newj-3]==num2&&a[newi+4][newj-4]==num2) //9
            {
                if(a[newi+1][newj-1]==0)
                {
                    a[newi+1][newj-1]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2&&a[newi+2][newj-2]==num2&&a[newi-1][newj+1]==num2&&a[newi-2][newj+2]==num2)  //10
            {
                if(a[newi+1][newj-1]==0)
                {
                    a[newi+1][newj-1]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2&&a[newi-2][newj+2]==num2&&a[newi-3][newj+3]==num2&&a[newi-4][newj+4]==2)   //11
            {
                if(a[newi-1][newj+1]==0)
                {
                    a[newi-1][newj+1]=num1;
                    putchess(a);
                    return 5;
                }
            }
            if(a[newi][newj]==num2&&a[newi+1][newj-1]==num2&&a[newi+2][newj-2]==num2&&a[newi-2][newj+2]==num2) //12
            {
                if(a[newi-1][newj+1]==0)
                {
                    a[newi-1][newj+1]=num1;
                    putchess(a);
                    return 5;
                }
            }
          //zuo xie lian 4


// Yi Shang Lian 4

}
judg3_1(int a[16][16],int newi,int newj,int num1,int num2)
{
    if(a[newi][newj]==num2&&a[newi-2][newj]==num2&&a[newi-3][newj]==num2 && a[newi-4][newj]==0&&a[newi-1][newj]==0&&a[newi+1][newj]==0)
    {
        a[newi-1][newj]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi-1][newj]==num2&&a[newi-3][newj]==num2 && a[newi-4][newj]==0&&a[newi-2][newj]==0&&a[newi+1][newj]==0)
    {
        a[newi-2][newj]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi-1][newj]==num2&&a[newi-2][newj]==num2 && a[newi-3][newj]==0&&a[newi+1][newj]==0)
    {
        a[newi-3][newj]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2 && a[newi-2][newj]==num2 && a[newi+1][newj]==num2 && a[newi-3][newj]==0&&a[newi-1][newj]==0&&a[newi+2][newj]==0)
    {
        a[newi-1][newj]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi-1][newj]==num2&&a[newi+1][newj]==num2 && a[newi-2][newj]==0&&a[newi+2][newj]==0)
    {
        a[newi-2][newj]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi-1][newj]==num2&&a[newi+2][newj]==num2 && a[newi-2][newj]==0&&a[newi+1][newj]==0&&a[newi+3][newj]==0)
    {
        a[newi+1][newj]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi+1][newj]==num2&&a[newi+2][newj]==num2 && a[newi-1][newj]==0&&a[newi+3][newj]==0)
    {
        a[newi-1][newj]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi+1][newj]==num2&&a[newi+3][newj]==num2 && a[newi-1][newj]==0&&a[newi+2][newj]==0&&a[newi+4][newj]==0)
    {
        a[newi+2][newj]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi+2][newj]==num2&&a[newi+3][newj]==num2&& a[newi-1][newj]==0&&a[newi+1][newj]==0&&a[newi+4][newj]==0)
    {
        a[newi+1][newj]=num1;
        putchess(a);
        return 5;
    }

            //heng lian 3
    if(a[newi][newj]==num2&&a[newi-2][newj-2]==num2&&a[newi-3][newj-3]==num2 && a[newi-4][newj-4]==0&&a[newi-1][newj-1]==0&&a[newi+1][newj+1]==0)
    {
        a[newi-1][newj-1]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi-1][newj-1]==num2&&a[newi-3][newj-3]==num2 && a[newi-4][newj-4]==0&&a[newi-2][newj-2]==0&&a[newi+1][newj+1]==0)
    {
        a[newi-2][newj-2]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi-1][newj-1]==num2&&a[newi-2][newj-2]==num2 && a[newi-3][newj-3]==0&&a[newi+1][newj+1]==0)
    {
        a[newi-3][newj-3]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2 && a[newi-2][newj-2]==num2 && a[newi+1][newj+1]==num2 && a[newi-3][newj-3]==0&&a[newi-1][newj-1]==0&&a[newi+2][newj+2]==0)
    {
        a[newi-1][newj-1]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi-1][newj-1]==num2&&a[newi+1][newj+1]==num2 && a[newi-2][newj-2]==0&&a[newi+2][newj+2]==0)
    {
        a[newi-2][newj-2]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi-1][newj-1]==num2&&a[newi+2][newj+2]==num2 && a[newi-2][newj-2]==0&&a[newi+1][newj+1]==0&&a[newi+3][newj+3]==0)
    {
        a[newi+1][newj+1]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi+1][newj+1]==num2&&a[newi+2][newj+2]==num2 && a[newi-1][newj-1]==0&&a[newi+3][newj+3]==0)
    {
        a[newi-1][newj-1]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi+1][newj+1]==num2&&a[newi+3][newj+3]==num2 && a[newi-1][newj-1]==0&&a[newi+2][newj+2]==0&&a[newi+4][newj+4]==0)
    {
        a[newi+2][newj+2]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi+2][newj+2]==num2&&a[newi+3][newj+3]==num2&& a[newi-1][newj-1]==0&&a[newi+1][newj+1]==0&&a[newi+4][newj+4]==0)
    {
        a[newi+1][newj+1]=num1;
        putchess(a);
        return 5;
    }

            //you xie lian 3
    if(a[newi][newj]==num2&&a[newi][newj-2]==num2&&a[newi][newj-3]==num2 && a[newi][newj-4]==0&&a[newi][newj-1]==0&&a[newi][newj+1]==0)
    {
        a[newi][newj-1]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi][newj-1]==num2&&a[newi][newj-3]==num2 && a[newi][newj-4]==0&&a[newi][newj-2]==0&&a[newi][newj+1]==0)
    {
        a[newi][newj-2]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi][newj-1]==num2&&a[newi][newj-2]==num2 && a[newi][newj-3]==0&&a[newi][newj+1]==0)
    {
        a[newi][newj-3]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2 && a[newi][newj-2]==num2 && a[newi][newj+1]==num2 && a[newi][newj-3]==0&&a[newi][newj-1]==0&&a[newi][newj+2]==0)
    {
        a[newi][newj-1]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi][newj-1]==num2&&a[newi][newj+1]==num2 && a[newi][newj-2]==0&&a[newi][newj+2]==0)
    {
        a[newi][newj-2]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi][newj-1]==num2&&a[newi][newj+2]==num2 && a[newi][newj-2]==0&&a[newi][newj+1]==0&&a[newi][newj+3]==0)
    {
        a[newi][newj+1]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi][newj+1]==num2&&a[newi][newj+2]==num2 && a[newi][newj-1]==0&&a[newi][newj+3]==0)
    {
        a[newi][newj-1]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi][newj+1]==num2&&a[newi][newj+3]==num2 && a[newi][newj-1]==0&&a[newi][newj+2]==0&&a[newi][newj+4]==0)
    {
        a[newi][newj+2]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi][newj+2]==num2&&a[newi][newj+3]==num2&& a[newi][newj-1]==0&&a[newi][newj+1]==0&&a[newi][newj+4]==0)
    {
        a[newi][newj+1]=num1;
        putchess(a);
        return 5;
    }

            //shu lian 3
    if(a[newi][newj]==num2&&a[newi+2][newj-2]==num2&&a[newi+3][newj-3]==num2 && a[newi+4][newj-4]==0&&a[newi+1][newj-1]==0&&a[newi-1][newj+1]==0)
    {
        a[newi+1][newj-1]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi+1][newj-1]==num2&&a[newi+3][newj-3]==num2 && a[newi+4][newj-4]==0&&a[newi+2][newj-2]==0&&a[newi-1][newj+1]==0)
    {
        a[newi+2][newj-2]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi+1][newj-1]==num2&&a[newi+2][newj-2]==num2 && a[newi+3][newj-3]==0&&a[newi-1][newj+1]==0)
    {
        a[newi+3][newj-3]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2 && a[newi+2][newj-2]==num2 && a[newi-1][newj+1]==num2 && a[newi+3][newj-3]==0&&a[newi+1][newj-1]==0&&a[newi-2][newj+2]==0)
    {
        a[newi+1][newj-1]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi+1][newj-1]==num2&&a[newi-1][newj+1]==num2 && a[newi+2][newj-2]==0&&a[newi-2][newj+2]==0)
    {
        a[newi+2][newj-2]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi+1][newj-1]==num2&&a[newi-2][newj+2]==num2 && a[newi+2][newj-2]==0&&a[newi-1][newj+1]==0&&a[newi-3][newj+3]==0)
    {
        a[newi-1][newj+1]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi-1][newj+1]==num2&&a[newi-2][newj+2]==num2 && a[newi+1][newj-1]==0&&a[newi-3][newj+3]==0)
    {
        a[newi+1][newj-1]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi-1][newj+1]==num2&&a[newi-3][newj+3]==num2 && a[newi+1][newj-1]==0&&a[newi-2][newj+2]==0&&a[newi-4][newj+4]==0)
    {
        a[newi-2][newj+2]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi-2][newj+2]==num2&&a[newi-3][newj+3]==num2&& a[newi+1][newj-1]==0&&a[newi-1][newj+1]==0&&a[newi-4][newj+4]==0)
    {
        a[newi-1][newj+1]=num1;
        putchess(a);
        return 5;
    }
//zuo xie lian 3
// Yi Shang Lian 3 Bidu
}

judg3_2(int a[16][16],int newi,int newj,int num1,int num2)
{
    if(a[newi][newj]==num2&&a[newi-2][newj]==num2&&a[newi-3][newj]==num2 &&a[newi-1][newj]==0)
    {
        if(a[newi-4][newj]==num1&&a[newi+1][newj]==0)
        {
            a[newi+1][newj]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+1][newj]==num1&&a[newi-4][newj]==0)
        {
            a[newi-4][newj]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi-1][newj]==num2&&a[newi-3][newj]==num2 &&a[newi-2][newj]==0)
    {
        if(a[newi-4][newj]==num1&&a[newi+1][newj]==0)
        {
            a[newi+1][newj]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+1][newj]==num1&&a[newi-4][newj]==0)
        {
            a[newi-4][newj]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi-1][newj]==num2&&a[newi-2][newj]==num2)
    {
        if(a[newi-3][newj]==num1&&a[newi+1][newj]==0)
        {
            a[newi+1][newj]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+1][newj]==num1&&a[newi-3][newj]==0)
        {
            a[newi-3][newj]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2 && a[newi-2][newj]==num2 && a[newi+1][newj]==num2 &&a[newi-1][newj] == 0)
    {
        if(a[newi-3][newj]==num1&&a[newi+2][newj]==0)
        {
            a[newi+2][newj]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+2][newj]==num1&&a[newi-3][newj]==0)
        {
            a[newi-3][newj]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi-1][newj]==num2&&a[newi+1][newj]==num2)
    {
        if(a[newi-2][newj]==num1&&a[newi+2][newj]==0)
        {
            a[newi+2][newj]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+2][newj]==num1&&a[newi-2][newj]==0)
        {
            a[newi-2][newj]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi-1][newj]==num2&&a[newi+2][newj]==num2 &&a[newi+1][newj] == 0)
    {
        if(a[newi-2][newj]==num1&&a[newi+3][newj]==0)
        {
            a[newi+3][newj]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+3][newj]==num1&&a[newi-2][newj]==0)
        {
            a[newi-2][newj]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi+1][newj]==num2&&a[newi+2][newj]==num2)
    {
        if(a[newi-1][newj]==num1&&a[newi+3][newj]==0)
        {
            a[newi+3][newj]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+3][newj]==num1&&a[newi-1][newj]==0)
        {
            a[newi-1][newj]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi+1][newj]==num2&&a[newi+3][newj]==num2 &&a[newi+2][newj]==0)
    {
        if(a[newi-1][newj]==num1&&a[newi+4][newj]==0)
        {
            a[newi+4][newj]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+4][newj]==num1&&a[newi-1][newj]==0)
        {
            a[newi-1][newj]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi+2][newj]==num2&&a[newi+3][newj]==num2 &&a[newi+1][newj]==0)
    {
        if(a[newi-1][newj]==num1&&a[newi+4][newj]==0)
        {
            a[newi+4][newj]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+4][newj]==num1&&a[newi-1][newj]==0)
        {
            a[newi-1][newj]=num1;
            putchess(a);
            return 5;
        }
    }
//heng lian 3
    if(a[newi][newj]==num2&&a[newi-3][newj-3]==num2&&a[newi-2][newj-2]==num2 &&a[newi-1][newj-1]==0)
    {
        if(a[newi-4][newj-4]==num1&&a[newi+1][newj+1]==0)
        {
            a[newi+1][newj+1]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+1][newj+1]==num1&&a[newi-4][newj-4]==0)
        {
            a[newi-4][newj-4]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi-1][newj-1]==num2&&a[newi-3][newj-3]==num2 &&a[newi-2][newj-2]==0)
    {
        if(a[newi-4][newj-4]==num1&&a[newi+1][newj+1]==0)
        {
            a[newi+1][newj+1]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+1][newj+1]==num1&&a[newi-4][newj-4]==0)
        {
            a[newi-4][newj-4]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi-1][newj-1]==num2&&a[newi-2][newj-2]==num2)
    {
        if(a[newi-3][newj-3]==num1&&a[newi+1][newj+1]==0)
        {
            a[newi+1][newj+1]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+1][newj+1]==num1&&a[newi-3][newj-3]==0)
        {
            a[newi-3][newj-3]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2 && a[newi-2][newj-2]==num2 && a[newi+1][newj+1]==num2&&a[newi-1][newj-1] == 0)
    {
        if(a[newi-3][newj-3]==num1&&a[newi+2][newj+2]==0)
        {
            a[newi+2][newj+2]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+2][newj+2]==num1&&a[newi-3][newj-3]==0)
        {
            a[newi-3][newj-3]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi-1][newj-1]==num2&&a[newi+1][newj+1]==num2)
    {
        if(a[newi-2][newj-2]==num1&&a[newi+2][newj+2]==0)
        {
            a[newi+2][newj+2]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+2][newj+2]==num1&&a[newi-2][newj-2]==0)
        {
            a[newi-2][newj-2]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi-1][newj-1]==num2&&a[newi+2][newj+2]==num2&&a[newi+1][newj+1]==0)
    {
        if(a[newi-2][newj-2]==num1&&a[newi+3][newj+3]==0)
        {
            a[newi+3][newj+3]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+3][newj+3]==num1&&a[newi-2][newj-2]==0)
        {
            a[newi-2][newj-2]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi+1][newj+1]==num2&&a[newi+2][newj+2]==num2)
    {
        if(a[newi-1][newj-1]==num1&&a[newi+3][newj+3]==0)
        {
            a[newi+3][newj+3]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+3][newj+3]==num1&&a[newi-1][newj-1]==0)
        {
            a[newi-1][newj-1]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi+1][newj+1]==num2&&a[newi+3][newj+3]==num2&&a[newi+2][newj+2]==0)
    {
        if(a[newi-1][newj-1]==num1&&a[newi+4][newj+4]==0)
        {
            a[newi+4][newj+4]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+4][newj+4]==num1&&a[newi-1][newj-1]==0)
        {
            a[newi-1][newj-1]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi+2][newj+2]==num2&&a[newi+3][newj+3]==num2&&a[newi+1][newj+1]==0)
    {
        if(a[newi-1][newj-1]==num1&&a[newi+4][newj+4]==0)
        {
            a[newi+4][newj+4]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+4][newj+4]==num1&&a[newi-1][newj-1]==0)
        {
            a[newi-1][newj-1]=num1;
            putchess(a);
            return 5;
        }
    }
    //you xie lian 3
    if(a[newi][newj]==num2&&a[newi][newj-3]==num2&&a[newi][newj-2]==num2&&a[newi][newj-1]==0)
    {
        if(a[newi][newj-4]==num1&&a[newi][newj+1]==0)
        {
            a[newi][newj+1]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi][newj+1]==num1&&a[newi][newj-4]==0)
        {
            a[newi][newj-4]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi][newj-1]==num2&&a[newi][newj-3]==num2&&a[newi][newj-2]==0)
    {
        if(a[newi][newj-4]==num1&&a[newi][newj+1]==0)
        {
            a[newi][newj+1]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi][newj+1]==num1&&a[newi][newj-4]==0)
        {
            a[newi][newj-4]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi][newj-1]==num2&&a[newi][newj-2]==num2)
    {
        if(a[newi][newj-3]==num1&&a[newi][newj+1]==0)
        {
            a[newi][newj+1]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi][newj+1]==num1&&a[newi][newj-3]==0)
        {
            a[newi][newj-3]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2 && a[newi][newj-2]==num2 && a[newi][newj+1]==num2&&a[newi][newj-1] == 0)
    {
        if(a[newi][newj-3]==num1&&a[newi][newj+2]==0)
        {
            a[newi][newj+2]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi][newj+2]==num1&&a[newi][newj-3]==0)
        {
            a[newi][newj-3]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi][newj-1]==num2&&a[newi][newj+1]==num2)
    {
        if(a[newi][newj-2]==num1&&a[newi][newj+2]==0)
        {
            a[newi][newj+2]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi][newj+2]==num1&&a[newi][newj-2]==0)
        {
            a[newi][newj-2]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi][newj-1]==num2&&a[newi][newj+2]==num2&&a[newi][newj+1]==0)
    {
        if(a[newi][newj-2]==num1&&a[newi][newj+3]==0)
        {
            a[newi][newj+3]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi][newj+3]==num1&&a[newi][newj-2]==0)
        {
            a[newi][newj-2]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi][newj+1]==num2&&a[newi][newj+2]==num2)
    {
        if(a[newi][newj-1]==num1&&a[newi][newj+3]==0)
        {
            a[newi][newj+3]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi][newj+3]==num1&&a[newi][newj-1]==0)
        {
            a[newi][newj-1]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi][newj+1]==num2&&a[newi][newj+3]==num2&&a[newi][newj+2]==0)
    {
        if(a[newi][newj-1]==num1&&a[newi][newj+4]==0)
        {
            a[newi][newj+4]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi][newj+4]==num1&&a[newi][newj-1]==0)
        {
            a[newi][newj-1]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi][newj+2]==num2&&a[newi][newj+3]==num2&&a[newi][newj+1]==0)
    {
        if(a[newi][newj-1]==num1&&a[newi][newj+4]==0)
        {
            a[newi][newj+4]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi][newj+4]==num1&&a[newi][newj-1]==0)
        {
            a[newi][newj-1]=num1;
            putchess(a);
            return 5;
        }
    }
    //shu lian 3
    if(a[newi][newj]==num2&&a[newi-3][newj+3]==num2&&a[newi-2][newj+2]==num2&&a[newi-1][newj+1]==0)
    {
        if(a[newi-4][newj+4]==num1&&a[newi+1][newj-1]==0)
        {
            a[newi+1][newj-1]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+1][newj-1]==num1&&a[newi-4][newj+4]==0)
        {
            a[newi-4][newj+4]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi-1][newj+1]==num2&&a[newi-3][newj+3]==num2&&a[newi-2][newj+2]==0)
    {
        if(a[newi-4][newj+4]==num1&&a[newi+1][newj-1]==0)
        {
            a[newi+1][newj-1]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+1][newj-1]==num1&&a[newi-4][newj+4]==0)
        {
            a[newi-4][newj+4]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi-1][newj+1]==num2&&a[newi-2][newj+2]==num2)
    {
        if(a[newi-3][newj+3]==num1&&a[newi+1][newj-1]==0)
        {
            a[newi+1][newj-1]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+1][newj-1]==num1&&a[newi-3][newj+3]==0)
        {
            a[newi-3][newj+3]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2 && a[newi-2][newj+2]==num2 && a[newi+1][newj-1]==num2&&a[newi-1][newj+1] == 0)
    {
        if(a[newi-3][newj+3]==num1&&a[newi+2][newj-2]==0)
        {
            a[newi+2][newj-2]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+2][newj-2]==num1&&a[newi-3][newj+3]==0)
        {
            a[newi-3][newj+3]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi-1][newj+1]==num2&&a[newi+1][newj-1]==num2)
    {
        if(a[newi-2][newj+2]==num1&&a[newi+2][newj-2]==0)
        {
            a[newi+2][newj-2]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+2][newj-2]==num1&&a[newi-2][newj+2]==0)
        {
            a[newi-2][newj+2]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi-1][newj+1]==num2&&a[newi+2][newj-2]==num2&&a[newi+1][newj-1]==0)
    {
        if(a[newi-2][newj+2]==num1&&a[newi+3][newj-3]==0)
        {
            a[newi+3][newj-3]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+3][newj-3]==num1&&a[newi-2][newj+2]==0)
        {
            a[newi-2][newj+2]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi+1][newj-1]==num2&&a[newi+2][newj-2]==num2)
    {
        if(a[newi-1][newj+1]==num1&&a[newi+3][newj-3]==0)
        {
            a[newi+3][newj-3]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+3][newj-3]==num1&&a[newi-1][newj+1]==0)
        {
            a[newi-1][newj+1]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi+1][newj-1]==num2&&a[newi+3][newj-3]==num2&&a[newi+2][newj-2]==0)
    {
        if(a[newi-1][newj+1]==num1&&a[newi+4][newj-4]==0)
        {
            a[newi+4][newj-4]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+4][newj-4]==num1&&a[newi-1][newj+1]==0)
        {
            a[newi-1][newj+1]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi+2][newj-2]==num2&&a[newi+3][newj-3]==num2&&a[newi+1][newj-1]==0)
    {
        if(a[newi-1][newj+1]==num1&&a[newi+4][newj-4]==0)
        {
            a[newi+4][newj-4]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+4][newj-4]==num1&&a[newi-1][newj+1]==0)
        {
            a[newi-1][newj+1]=num1;
            putchess(a);
            return 5;
        }
    }
//zuo xie lian 3
/* Yi Shang Lian 3 */
}
judg2_1(int a[16][16],int newi,int newj,int num1,int num2)
{
    if(a[newi][newj]==num2&&a[newi-1][newj]==num2 &&a[newi-2][newj]==0&&a[newi+1][newj]==0)
    {
        if(random(1)==0)
        {
            a[newi+1][newj]=num1;
            putchess(a);
            return 5;
        }
        if(random(1)==1)
        {
            a[newi-2][newj]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi+1][newj]==num2 &&a[newi-1][newj]==0&&a[newi+2][newj]==0)
    {
        if(random(1)==0)
        {
            a[newi+2][newj]=num1;
            putchess(a);
            return 5;
        }
        if(random(1)==1)
        {
            a[newi-1][newj]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi-2][newj]==num2 &&a[newi-3][newj]==0&&a[newi-1][newj]==0&&a[newi+1][newj]==0)
    {
        a[newi-1][newj]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi+2][newj]==num2 &&a[newi-1][newj]==0&&a[newi+1][newj]==0&&a[newi+3][newj]==0)
    {
        a[newi+1][newj]=num1;
        putchess(a);
        return 5;
    }
//hen 2
    if(a[newi][newj]==num2&&a[newi-1][newj-1]==num2 &&a[newi-2][newj-2]==0&&a[newi+1][newj+1]==0)
    {
        if(random(1)==0)
        {
            a[newi+1][newj+1]=num1;
            putchess(a);
            return 5;
        }
        if(random(1)==1)
        {
            a[newi-2][newj-2]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi+1][newj+1]==num2 &&a[newi-1][newj-1]==0&&a[newi+2][newj+2]==0)
    {
        if(random(1)==0)
        {
            a[newi+2][newj+2]=num1;
            putchess(a);
            return 5;
        }
        if(random(1)==1)
        {
            a[newi-1][newj-1]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi-2][newj-2]==num2 &&a[newi-3][newj-3]==0&&a[newi-1][newj-1]==0&&a[newi+1][newj+1]==0)
    {
        a[newi-1][newj-1]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi+2][newj+2]==num2 &&a[newi-1][newj-1]==0&&a[newi+1][newj+1]==0&&a[newi+3][newj+3]==0)
    {
        a[newi+1][newj+1]=num1;
        putchess(a);
        return 5;
    }
//you xie 2

    if(a[newi][newj]==num2&&a[newi][newj-1]==num2 &&a[newi][newj-2]==0&&a[newi][newj+1]==0)
    {
        if(random(1)==0)
        {
            a[newi][newj+1]=num1;
            putchess(a);
            return 5;
        }
        if(random(1)==1)
        {
            a[newi][newj-2]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi][newj+1]==num2 &&a[newi][newj-1]==0&&a[newi][newj+2]==0)
    {
        if(random(1)==0)
        {
            a[newi][newj+2]=num1;
            putchess(a);
            return 5;
        }
        if(random(1)==1)
        {
            a[newi][newj-1]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi][newj-2]==num2 &&a[newi][newj-3]==0&&a[newi][newj-1]==0&&a[newi][newj+1]==0)
    {
        a[newi][newj-1]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi][newj+2]==num2 &&a[newi][newj-1]==0&&a[newi][newj+1]==0&&a[newi][newj+3]==0)
    {
        a[newi+1][newj+1]=num1;
        putchess(a);
        return 5;
    }
//shu 2

    if(a[newi][newj]==num2&&a[newi+1][newj-1]==num2 &&a[newi+2][newj-2]==0&&a[newi-1][newj+1]==0)
    {
        if(random(1)==0)
        {
            a[newi-1][newj+1]=num1;
            putchess(a);
            return 5;
        }
        if(random(1)==1)
        {
            a[newi+2][newj-2]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi-1][newj+1]==num2 &&a[newi+1][newj-1]==0&&a[newi-2][newj+2]==0)
    {
        if(random(1)==0)
        {
            a[newi-2][newj+2]=num1;
            putchess(a);
            return 5;
        }
        if(random(1)==1)
        {
            a[newi+1][newj-1]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi+2][newj-2]==num2 &&a[newi+3][newj-3]==0&&a[newi+1][newj-1]==0&&a[newi-1][newj+1]==0)
    {
        a[newi+1][newj-1]=num1;
        putchess(a);
        return 5;
    }
    if(a[newi][newj]==num2&&a[newi-2][newj+2]==num2 &&a[newi+1][newj-1]==0&&a[newi-1][newj+1]==0&&a[newi-3][newj+3]==0)
    {
        a[newi-1][newj+1]=num1;
        putchess(a);
        return 5;
    }
//zuo xie 2
}
judg2_2(int a[16][16],int newi,int newj,int num1,int num2)
{
    if(a[newi][newj]==num2&&a[newi-1][newj]==num2)
    {
        if(a[newi+1][newj]==0)
        {
            a[newi+1][newj]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi-2][newj]==0)
        {
            a[newi-2][newj]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi+1][newj]==num2)
    {
        if(a[newi+2][newj]==0)
        {
            a[newi+2][newj]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi+2][newj]==0)
        {
            a[newi-1][newj]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi-2][newj]==num2)
        if(a[newi-1][newj]==0)
        {
            a[newi-1][newj]=num1;
            putchess(a);
            return 5;
        }
    if(a[newi][newj]==num2&&a[newi+2][newj]==num2)
        if(a[newi+1][newj]==0)
        {
            a[newi+1][newj]=num1;
            putchess(a);
            return 5;
        }

    if(a[newi][newj]==num2&&a[newi-1][newj-1]==num2)
    {
        if(a[newi+1][newj+1]==0)
        {
            a[newi+1][newj+1]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi-2][newj-2]==0)
        {
            a[newi-2][newj-2]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi+1][newj+1]==num2)
    {
        if(a[newi+2][newj+2]==0)
        {
            a[newi+2][newj+2]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi-1][newj-1]==0)
        {
            a[newi-1][newj-1]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi-2][newj-2]==num2)
        if(a[newi-1][newj-1]==0)
        {
            a[newi-1][newj-1]=num1;
            putchess(a);
            return 5;
        }
    if(a[newi][newj]==num2&&a[newi+2][newj+2]==num2)
        if(a[newi+1][newj+1]==0)
        {
            a[newi+1][newj+1]=num1;
            putchess(a);
            return 5;
        }

    if(a[newi][newj]==num2&&a[newi][newj-1]==num2)
    {
        if(a[newi][newj+1]==0)
        {
            a[newi][newj+1]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi][newj-2]==0)
        {
            a[newi][newj-2]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi][newj+1]==num2)
    {
        if(a[newi][newj+2]==0)
        {
            a[newi][newj+2]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi][newj-1]==0)
        {
            a[newi][newj-1]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi][newj-2]==num2)
        if(a[newi][newj-1]==0)
        {
            a[newi][newj-1]=num1;
            putchess(a);
            return 5;
        }
    if(a[newi][newj]==num2&&a[newi][newj+2]==num2)
        if(a[newi][newj+1]==0)
        {
            a[newi][newj+1]=num1;
            putchess(a);
            return 5;
        }

    if(a[newi][newj]==num2&&a[newi-1][newj+1]==num2)
    {
        if(a[newi+1][newj-1]==0)
        {
            a[newi+1][newj-1]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi-2][newj+2]==0)
        {
            a[newi-2][newj+2]=num1;
            putchess(a);
            return 5;
        }
    }
    if(a[newi][newj]==num2&&a[newi+1][newj-1]==num2)
    {
        if(a[newi+2][newj-2]==0)
        {
            a[newi+2][newj-2]=num1;
            putchess(a);
            return 5;
        }
        if(a[newi-1][newj+1]==0)
        {
            a[newi-1][newj+1]=num1;
            putchess(a);
            return 5;
        }
    if(a[newi][newj]==num2&&a[newi+2][newj-2]==num2)
        if(a[newi+1][newj-1]==0)
        {
            a[newi+1][newj-1]=num1;
            putchess(a);
            return 5;
        }
    if(a[newi][newj]==num2&&a[newi-2][newj+2]==num2)
        if(a[newi-1][newj+1]==0)
        {
            a[newi-1][newj+1]=num1;
            putchess(a);
            return 5;
        }

    }
}

judg1_1(int a[16][16],int newi,int newj,int num1,int num2)
{
    if(a[newi][newj]==num2)
    {
        if(random(7)==0&&a[newi][newj-1]==0)
        {
            a[newi][newj-1]=num1;
            putchess(a);
            return 5;
        }
        if(random(7)==1&&a[newi][newj+1]==0)
        {
            a[newi][newj+1]=num1;
            putchess(a);
            return 5;
        }
        if(random(7)==2&&a[newi-1][newj]==0)
        {
            a[newi-1][newj]=num1;
            putchess(a);
            return 5;
        }
        if(random(7)==3&&a[newi+1][newj]==0)
        {
            a[newi+1][newj]=num1;
            putchess(a);
            return 5;
        }
        if(random(7)==4&&a[newi-1][newj-1]==0)
        {
            a[newi-1][newj-1]=num1;
            putchess(a);
            return 5;
        }
        if(random(7)==5&&a[newi+1][newj+1]==0)
        {
            a[newi+1][newj+1]=num1;
            putchess(a);
            return 5;
        }
        if(random(7)==6&&a[newi+1][newj-1]==0)
        {
            a[newi+1][newj-1]=num1;
            putchess(a);
            return 5;
        }
        if(random(7)==7&&a[newi-1][newj+1]==0)
        {
            a[newi-1][newj+1]=num1;
            putchess(a);
            return 5;
        }
    }
}

int comp_4_1put(int a[16][16])
{
    int i,j;
    for(i=4;i<=11;i++)
        for(j=4;j<=11;j++)
            if(judg4_1(a,i,j,1,1)==5)
                return 6;
}
int user_4_1put(int a[16][16])
{
    int i,j;
    for(i=4;i<=11;i++)
        for(j=4;j<=11;j++)
            if(judg4_1(a,i,j,1,2)==5)
                return 6;
}
int comp_3_1put(int a[16][16])
{
    int i,j;
    for(i=4;i<=11;i++)
        for(j=4;j<=11;j++)
            if(judg3_1(a,i,j,1,1)==5)
                return 6;
}
int user_3_1put(int a[16][16])
{
    int i,j;
    for(i=4;i<=11;i++)
        for(j=4;j<=11;j++)
            if(judg3_1(a,i,j,1,2)==5)
                return 6;
}
int comp_3_2put(int a[16][16])
{
    int i,j;
    for(i=4;i<=11;i++)
        for(j=4;j<=11;j++)
            if(judg3_2(a,i,j,1,1)==5)
                return 6;
}
int user_3_2put(int a[16][16])
{
    int i,j;
    for(i=4;i<=11;i++)
        for(j=4;j<=11;j++)
            if(judg3_2(a,i,j,1,2)==5)
                return 6;
}

int comp_2_1put(int a[16][16])
{
    int i,j;
    for(i=4;i<=11;i++)
        for(j=4;j<=11;j++)
            if(judg2_1(a,i,j,1,1)==5)
                return 6;
}
int user_2_1put(int a[16][16])
{
    int i,j;
    for(i=4;i<=11;i++)
        for(j=4;j<=11;j++)
            if(judg2_1(a,i,j,1,2)==5)
                return 6;
}
int comp_2_2put(int a[16][16])
{
    int i,j;
    for(i=4;i<=11;i++)
        for(j=4;j<=11;j++)
            if(judg2_2(a,i,j,1,1)==5)
                return 6;
}
int user_2_2put(int a[16][16])
{
    int i,j;
    for(i=4;i<=11;i++)
        for(j=4;j<=11;j++)
            if(judg2_2(a,i,j,1,2)==5)
                return 6;
}
int comp_1_1put(int a[16][16])
{
    int i,j;
    for(i=4;i<=11;i++)
        for(j=4;j<=11;j++)
            if(judg1_1(a,i,j,1,1)==5)
                return 6;
}
int user_1_1put(int a[16][16])
{
    int i,j;
    for(i=4;i<=11;i++)
        for(j=4;j<=11;j++)
            if(judg1_1(a,i,j,1,2)==5)
                return 6;
}

chesstable()
{
    int i,j;
    setlinestyle(0,0,0);
    setcolor(2);
    for(i=0;i<=15;i++)
        for(j=0;j<=15;j++)
            rectangle(50+i*20,50+j*20,i*20+70,j*20+70);
}

main(void)
{
    int i = 0,j = 0, k, l, m, n, x = 0, y = 0;
    int weii, weij;
    int a[16][16], b[16][16];
    int gd=0, gm;
    for(k = 0; k < 16; k++)
        for(l = 0; l < 16; l++)
            a[k][l]=0;

    initgraph(&gd, &gm, "f:\\shiter\\tc\\");
    setbkcolor(0);
    chesstable();

    gotoxy(55, 4);    printf("PLAY_1       ");
    gotoxy(60, 5);    printf("E     -- 上  ");
    gotoxy(60, 7);    printf("D     -- 下  ");
    gotoxy(60, 9);    printf("S     -- 左  ");
    gotoxy(60, 11);    printf("F     -- 右  ");
    gotoxy(60, 13);    printf("SPACE --确定 ");
    gotoxy(55, 15);    printf("PLAY_2       ");
    gotoxy(60, 16);    printf("UP    -- 上  ");
    gotoxy(60, 18);    printf("DOWN  -- 下  ");
    gotoxy(60, 20);    printf("LEFT  -- 左  ");
    gotoxy(60, 22);    printf("RIGHT -- 右  ");
    gotoxy(60, 24);    printf("DEL   -- 确定");

    while(1)
    {
//        setlinestyle(0, 0, 3);
//        line(x + 50 - 8, y + 58, x + 58, y + 58);
        if(f%2==0)
        {
            if(comp_4_1put(a)==6)
                continue;
            if(user_4_1put(a)==6)
                continue;
            if(comp_3_1put(a)==6)
                continue;
            if(user_3_1put(a)==6)
                continue;
            if(comp_3_2put(a)==6)
                continue;
            if(comp_2_1put(a)==6)
                continue;
            if(user_3_2put(a)==6)
                continue;
            if(comp_1_1put(a)==6)
                continue;
            if(user_2_1put(a)==6)
                continue;
            if(user_1_1put(a)==6)
                continue;
            f++;
        }
        else
        {
            while(bioskey(1)!=0)
            {
                i=x/20;
                j=y/20;
                switch(bioskey(0))
                {
                    case KEY_UP:    setlinestyle(0,0,3);
                            setcolor(0);
                            line(x+42,y+58,x+58,y+58);
                            setcolor(2);
                            setlinestyle(0,0,0);
                            line(x+50,y+57,x+50,y+59);
                            y-=20;
                            if(y<0)
                                y=0;
                            setlinestyle(0,0,3);
                            line(x+42,y+58,x+58,y+58);
                            break;
                    case KEY_DOWN:  setlinestyle(0,0,3);
                            setcolor(0);
                            line(x+42,y+58,x+58,y+58);
                            setcolor(2);
                            setlinestyle(0,0,0);
                            line(x+50,y+57,x+50,y+59);
                            y+=20;
                            if(y>300)
                                y=300;
                            setlinestyle(0,0,3);
                            line(x+42,y+58,x+58,y+58);
                            break;
                    case KEY_LEFT:  setlinestyle(0,0,3);
                            setcolor(0);
                            line(x+42,y+58,x+58,y+58);
                            setcolor(2);
                            setlinestyle(0,0,0);
                            line(x+50,y+57,x+50,y+59);
                            x-=20;
                            if(x<0)
                                x=0;
                            setlinestyle(0,0,3);
                            line(x+42,y+58,x+58,y+58);
                            break;
                    case KEY_RIGHT: setlinestyle(0,0,3);
                            setcolor(0);
                            line(x+42,y+58,x+58,y+58);
                            setcolor(2);
                            setlinestyle(0,0,0);
                            line(x+50,y+57,x+50,y+59);
                            x+=20;
                            if(x>320)
                                x=320;
                            setlinestyle(0,0,3);
                            line(x+42,y+58,x+58,y+58);
                            break;
                    case KEY_SPACE:if(a[i][j]==0)
                            {
                                a[i][j]=4;
                                setlinestyle(0,0,3);
                                setcolor(0);
                                line(x+42,y+58,x+58,y+58);
                                putchess(a);
                                continue;
                            }
                            continue;
                    case KEY_ESC:      again();
                    line(x+42,y+58,x+58,y+58);
                }
            }
        }
    }
    getch();
}

回复列表 (共51个回复)

41 楼

你好:
   你的程序做的很好,我想请教一下关于鼠标操作,你那是TC3.0下做的,而在TC2.0下能不能用你那个鼠标函数。
   我试了一下,就连头文件“mousea.h”都打不开,是不是不能用在TC2.0下。[em18][size=3]3[/size][color=00FF00]00FF00[/color]

42 楼

楼主,你真牛,呵呵,也给我发一份 james45@163.net
thx!:)

43 楼

楼主我也要一份了,谢了
  maoruofei@163.com

44 楼

看到后面的一些回帖我很高兴,但也很难过,因为大家都能看到我从4月后就没有在上这个论坛了,并不是我不想来,而是工作太忙了,几乎没有时间上网。在这里我想跟大家说声对不起。我把以前的帖子都给大家回复一下,不论大家是不是还能看的到。

sonoftheshine@sina.com.cn
chenbupt@sohu.com
zhang123123san@126.com
ltdnpx@tom.com
heisini@126.com
jiali0527.student@sina.com
james45@163.net
maoruofei@163.com
上面这些邮件地址我都会在明天按大家的要求给大家发出去的。

闪电C客:
    能在TC2.0里运行的就能在3.0里面运行。我的程序两个里面都可以运行的,只需要小小的修改就可以了,注意注释的标法就可以了。
name_lantian兄:
    我也很喜欢玩五子棋的,可惜现在都有两年没有玩了,水平一定很差了,呵呵,我记得当时我快高考的时候在外面上学习班的时候,都跟同学在桌子底下玩五子棋,真是怀念哪个时候啊,
    至于我的程序里面三手可换,五手二打都没有编进去的,能运行就不错了,好象我还害怕我下不过电脑呢,结果只要我稍微下的长一些就能赢,嘿嘿,你说你看不懂我的程序,唉连我现在都看起来很费劲,我个人觉得只个程序编的并不好,重复的语句太多,没有办法简化(我还不知道怎么简化)如果我以后有时间的话我会写一个更好的,记得当时我还到图书馆去看五子棋走法的书了。看了才知道开局一般都是怎样开的,后面都是怎么走的,你要学的话,也应该去看看书上说的吧!呵呵

mywebpf兄:
    源程序和头文件上面都有啊,

jiali妹子:
    在你急需的时候没能帮上你的忙真是感到抱歉,不过还是希望在以后的时间里能多多互相学习!

6050766兄:
    哪个意思就是程序太长了,TC2.0处理不了了,要么将程序分成多个文件,要么用更大的内存模式,要么改用TC3.0
    TC速成里面的哪个是文本模式下的程序两个人对下的,我也玩过,程序是没有错的,也许是你的TC配置有问题吧,
    对了谁知道下面这个是什么意思?
    press=bioskey(0);
   lowbyte=press&0xff;
   press=press&0xff00 + toupper(lowbyte);
   return(press);
为什么要press跟0xff进行&呢?
谁知道的话告诉我啊 谢谢啦!

elsec:
    我的mousea.h就在上面啊,找找看!
gerujun:
    可以在TC2.0里运行的就能在3.0里面运行。我的程序两个里面都可以运行的,只需要小小的修改就可以了,注意注释的标法就可以了。头文件在上面,你要把他放到你的INCLUDE这个文件夹里面。就可以了。


45 楼

把相关的*.h贴上啊,我想看看你的程序能不能运行

46 楼

可以详细解释点吗?我是初学者,想学编程.能指教一下吗?

47 楼

你真的是大一编的吗
太牛B了
真的
我现在上大二还看不懂你的程序
唉~~~~

48 楼

能不能也给我发一个能运行的五子棋程序啊,我们马上要验收了,还没编好,真是急死人了谢谢啊!

49 楼

恩,楼主,编的真的不错,有空的话发一份给我吧,我的邮箱  weiyr023@163.com     
谢了,楼主,

50 楼

我觉得你这个程序有些地方可以换作别的,如数组变为指针,这样看上去不到于这么烦锁。
现在我是一名学生,我也在编这个程序,我大部分搞定了,只是重新启动这个模块没作好,请快速发一个给我,在这里先谢谢了,发与我的QQ,472882082!!!!!!

我来回复

您尚未登录,请登录后再回复。点此登录或注册