网络效果图
【计算机编程c语言入门 c在线编程菜鸟教程】代码如下:
#define _CRT_SECURE_NO_WARNINGS 1#include #include #include
char *ch; int color; char type;
}
charBorder = { “”, 4, 1 }, //边框charBg = { “”, 2, 2 }, //背景charSnake = { “”, 0xe, 3 }, //贪吃蛇节点charFood = { “”, 0xc, 4 }; //食物//用一个结构体数组保存地图中的各个点struct{
char type; int index;
}globalMap[MAXWIDTH][MAXHEIGHT];struct{
int x; int y;
} snakeMap[(MAXWIDTH – 2)*(MAXHEIGHT – 2)], scoresPostion;int scores = 0; //得分int snakeMapLen = (MAXWIDTH – 2)*(MAXHEIGHT – 2);int headerIndex, tailIndex;
HANDLE hStdin;
// 设置光标位置,x为行,y为列void setPosition(int x, int y){
COORD coord;
coord.X = 2 * y;
coord.Y = x;
SetCo
猜你喜欢
- 高考选择计算机专业注意事项 需要考虑的三个方面
- 常用python编程软件 python编程用什么软件开发
- 林志玲会说几国语言
- 怎么用wordpress建中英文双语及多语言切换的网站
- 汉语言文学类专业包括哪些专业
- 表达思念心情语言短句 表达思念的句子有哪些
- 汉语是全球通用语言吗
- 9527真正含义 9527有何含义
- 语言的诞生 语言是怎样产生的
- c语言sqrt sqrt什么意思
