演示效果 贪吃蛇1.0演示视频 将终端应用程序改为控制台主机 实现的基本功能 贪吃蛇地图绘制 蛇吃食物的功能(上、下、左、右⽅向键控制蛇的动作) 蛇撞墙死亡 蛇撞⾃⾝死亡 计算得分 蛇⾝加速、减速 暂停游戏 技术要点 c语言函数、枚举、结构体、动态内存管理、预处理指令、链表、Win32 API等等…… 源代码 snake.h #pragma once #include <stdio.h> #include <stdlib.h> #include <Windows.h> #include <locale.h> #include <stdbool.h> #include <time.h> #include <stdbool.h> #define KEY_PRESS(vk) ((GetAsyncKeyState(vk)&1)?1:0) #define WALL L'□' #define BODY L'●' #define FOOD L'★' #define POS_X 24 #define POS_Y 5 enum DIRECTION { UP = 1, DOWN, LEFT,...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with int
Contact int, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack