C语言贪吃蛇问题.编译可以,运行不出来(有的人运行可以)

来源:百度知道 编辑:UC知道 时间:2024/05/28 13:23:38
C语言贪吃蛇问题.编译可以,运行不出来(有的人运行可以)
很奇怪. 不知道为什么. 编译通过. 窗口闪动就关闭了
编译环境win-tc 机子32位机

发一下源代码呀!

看看我以前写的你能运行不

#include<stdio.h>
#include<graphics.h>
#include<bios.h>
#include<stdlib.h>
#include<conio.h>

#define BC LIGHTBLUE
#define FC RED
#define LEFT 0x4b00
#define RIGHT 0x4d00
#define DOWN 0x5000
#define UP 0x4800
#define ESC 0x011b
#define ONE 0x231
#define TWO 0x332
#define THREE 0x433

void printsnake(int x,int y,int corlor);
void moveh(int *x,int *y,char (*p)[30],int dir);
void movet(int *tx,int *ty,char (*p)[30]);
void food(char (*p)[30]);
void level(char (*p)[30]);
void ashui();
void drawmat(char *mat,int matsize,int x,int y,int color);

void main()
{
int x,y,tx,ty,driver=DETECT,mode,key,key1,score=0;
char snake[40][30]={0};
char s[10];
initgraph(&driver,&mode,"");
ashui();
level(snake);
outtextxy(80,60,&quo