Chinaunix首页 | 论坛 | 博客
  • 博客访问: 735191
  • 博文数量: 769
  • 博客积分: 6000
  • 博客等级: 准将
  • 技术积分: 4985
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-15 16:37
文章分类

全部博文(769)

文章存档

2011年(1)

2008年(768)

我的朋友

分类:

2008-10-15 16:39:34

    #include
    #include
    #include
    #include
    #include

    #define LEFT 0x4b00
    #define RIGHT 0x4d00
    #define DOWN 0x5000
    #define UP 0x4800
    #define ESC 0x011b
    #define SPACE 0x3920

    #define BILI 20
    #define JZ 4
    #define JS 3
    #define N 19

    int box[N][N];
    int step_x,step_y ;
    int key ;
    int flag=1 ;

    void draw_box();
    void draw_cicle(int x,int y,int color);
    void change();
    void judgewho(int x,int y);
    void judgekey();
    int judgeresult(int x,int y);
    void attentoin();

    void attention()
    {
        char ch ;
        gotoxy(20,4);
        printf("请注意(Attentoin please!)");
        gotoxy(20,6);
        printf("1.按左右上下方向键移动棋子");
        gotoxy(20,8);
        printf("2.按空格确定落棋子");
        gotoxy(20,10);
        printf("3.注意:禁止在棋盘外按空格");
        gotoxy(20,12);
        printf("你是否接受上叙的游戏规则(Y/N)");
        while(1)
        {
            gotoxy(51,12);
            ch=getche();
            if(ch=='Y'ch=='y')
            break ;
            else if(ch=='N'ch=='n')
            exit(0);
            gotoxy(51,12);
            printf(" ");
        }
    }
    void draw_box()
    {
        int x1,x2,y1,y2 ;
        setbkcolor(2);
        setcolor(1);
        for(x1=1,y1=1,y2=18;x1<=18;x1++)
        line((x1+JZ)*BILI,(y1+JS)*BILI,(x1+JZ)*BILI,(y2+JS)*BILI);
        for(x1=1,y1=1,x2=18;y1<=18;y1++)
        line((x1+JZ)*BILI,(y1+JS)*BILI,(x2+JZ)*BILI,(y1+JS)*BILI);
        for(x1=1;x1<=18;x1++)
        for(y1=1;y1<=18;y1++)
        box[x1][y1]=0 ;
    }

 

[1]  

【责编:landy】

--------------------next---------------------

阅读(305) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~