| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 946 人关注过本帖
标题:错误在哪
只看楼主 加入收藏
xhrneverstop
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2018-11-17
收藏
 问题点数:0 回复次数:0 
错误在哪
/*头文件*/
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <windows.h>
/*宏定义*/
#define MAXIMUS 15
/*函数声明*/
int p[MAXIMUS][MAXIMUS];
char buff[MAXIMUS*2+1][MAXIMUS*4+3];
int Cx,Cy;
int Now;
int wl,wp;
char* showText;
int count;
void explation();
void gotoxy(int x,int y);
int color(int c);
/*设置光标位置*/
void gotoxy(int x,int y)
{
    COORD c;
    c.X=x;
    c.Y=y;
    SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),c);
}
/*文字颜色函数,此函数的局限性:1.只能Windows系统下使用;2.不能改变背景颜色*/
#include <windows.h>
int color(int c)
{
    SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),c);
    return 0;
}
/*开始界面*/
void welcometogame()
{
    int n;
    int i,j=1;
    gotoxy(23,2);
    color(13);
    printf("五 子 棋 游 戏");
    color(15);
    for (i=6;i<=12;i++)
    {
        for (j=7;j<=54;j++)
        {
            gotoxy(j,i);
            if (i==6||i==12)
            {
                printf("-");
            }
            else if (j==7||j==54)
            {
                printf("|");
            }
        }
    }
    color(14);
    gotoxy(15,8);
    printf("1.游戏开始");
    gotoxy(35,8);
    printf("2.游戏说明");
    gotoxy(15,10);
    printf("3.退出游戏");
    gotoxy(19,13);
    color(12);
    printf("请选择[1 2 3]:[ ]\b\b");
    color(14);
    scanf("%d",&n);
    switch (n)
    {
        case 1:
            system("cls");
            RunGame();
            break;
        case 2:
            explation();
            break;
        case 3:
            exit(0);
            break;
    }
}
/*游戏说明*/
void explation()
{
    int i,j=1;
    system("cls");
    color(13);
    gotoxy(27,3);
    printf("游戏说明");
    color(5);
    for (i=6;i<=22;i++)
    {
        for (j=3;j<=58;j++)
        {
            gotoxy(j,i);
            if (i==6||i==22) printf("=");
            else if (j==3||j==58) printf("||");
        }
    }
    color(15);
    gotoxy(10,8);
    printf("tip1:用↑.↓.←.→控制光标的位置");
    color(14);
    gotoxy(10,11);
    printf("tip2:用空格键确定下棋子");
    color(12);
    gotoxy(10,14);
    printf("tip3:黑白棋哪个先上下左右5个连在一起,得胜利");
    color(11);
    gotoxy(10,17);
    printf("tip4:按<Esc>退出游戏");
    getch();
    system("cls");
    welcometogame();
}
搜索更多相关主题的帖子: include int color printf 游戏 
2018-11-17 23:36
快速回复:错误在哪
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022778 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved