匿名用户
1级
2012-05-12 回答
/*加载头文件*/
#include
#include
#include
#include
#include
/*编译预处理,定义按键码*/
#define LEFT 0x4b00
#define RIGHT 0x4d00
#define DOWN 0x5000
#define UP 0x4800
/*若想在游戏中途退出, 可按 Esc 键*/
#define ESC 0x011b
/*SPACE键表示落子*/
#define SPACE 0x3920
/*设置偏移量*/
#define OFFSET 20
#define OFFSET_x 4
#define OFFSET_y 3
/*定义数组大小*/
#define N 19
/*定义全局变量*/
int status[N][N]; /*定义的数组,保存状态*/
int step_x,step_y;/*行走的坐标*/
int key ; /*获取按下的键盘的键*/
int flag; /*玩家标志*/
/*自定义函数原型*/
void DrawBoard();
void DrawCircle(int x,int y,int color);
void Alternation();
void JudgePlayer(int x,int y);
void Done();
int ResultCheck(int x,int y);
void WelcomeInfo();
void ShowMessage();
/*定义函数*/
/*显示欢迎信息函数*/
void WelcomeInfo()
{
char ch ;
/*移动光标到指定位置*/
gotoxy(12,4);
/*显示欢迎信息*/
printf("Welcome you to gobang word!");
gotoxy(12,6);
printf("1.You can use the up,down,left and right key to move the chessman,");
gotoxy(12,8);
printf(" and you can press Space key to enter after you move it !");
gotoxy(12,10);
printf("2.You can use Esc key to exit the game too !");
gotoxy(12,12);
追问:
要能运行的代码