登录
首页 » Windows开发 » C语言实现贪吃蛇

C语言实现贪吃蛇

于 2022-05-15 发布 文件大小:42.51 kB
0 235
下载积分: 2 下载次数: 1

代码说明:

//: Snake.c /* * * * * * * * * * * * * * * * * * * * * * * // Project: RedSnake(贪吃蛇) // Author: Problue // Version: 1.0 // Date: 19:55 2012-10-29 * * * * * * * * * * * * * * * * * * * * * * */ #include #include #include #include "pcc32.h" // 定义地图的尺寸及坐标 #define MAP_WIDTH 32 // 地图宽度 #define MAP_HEIGHT 32 // 地图高度 #define OFFSET_X 1 // 地图左右的边距 #define OFFSET_Y 1 // 地图上下的边距 #define TOTAL_WIDTH (MAP_WIDTH + OFFSET_X * 2) // 窗口宽度 #define TOTAL_HEIGHT (MAP_HEIGHT + OFFSET_Y * 2) // 窗口高度 #define GotoMap(x, y) gotoTextPos((x) * 2, (y)) // 定义地图方格的状态,分别为: 空格、蛇头、蛇身、蛇尾、食物 #define BS_SPACE 0 #define BS_SHEAD 1 #define BS_SBODY 2 #define BS_STAIL 3 #define BS_FOOD 4 // 蛇默认长度 #define SNAKE_MIN_LEN 5 // 定义蛇运动方向: 上、下、左、右 #define DIR_UP 1 #define DIR_DOWN 2 #define DIR_LEFT 3

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • Magnifier+Spotlight WPF Custom Control
    Here are two examples of custom control available in WPF-based Windows applications. Magnifier can zoom in on specific parts. Spotlight can only show specific parts. You can learn how to use generic themes in custom control. The picture below shows a screenshot.
    2022-11-29 14:20:03下载
    积分:1
  • LED组8
    ========================================================================
    2022-03-11 15:28:31下载
    积分:1
  • 1).能够实现对班级学生基本信息的录入,包括学生的学号,姓名,性别,专业,民族以及出生年月等。 2).能够实现对学生基本信息的修改。 3).根据学号对学生信息进...
    1).能够实现对班级学生基本信息的录入,包括学生的学号,姓名,性别,专业,民族以及出生年月等。 2).能够实现对学生基本信息的修改。 3).根据学号对学生信息进行查询。 4).能够删除某些学生的信息。-1)able to insert the basic information of students,including number,gender,major,nation and birthday. 2)able to modify basic information of students. 3)query student s information by his/her number. 4)delete information of certain students.
    2023-01-22 18:05:03下载
    积分:1
  • 算法实现题2
    算法实现题2-1 输油管道问题 « 问题描述: 某石油公司计划建造一条由东向西的主输油管道。该管道要穿过一个有n 口油井的油 田。从每口油井都要有一条输油管道沿最短路经(或南或北)与主管道相连。如果给定n口油 井的位置,即它们的x 坐标(东西向)和y 坐标(南北向),应如何确定主管道的最优位置, 即使各油井到主管道之间的输油管道长度总和最小的位置?证明可在线性时间内确定主管道 的最优位置。 « 编程任务: 给定n 口油井的位置,编程计算各油井到主管道之间的输油管道最小长度总和。 « 数据输入: 由文件input.txt 提供输入数据。文件的第1 行是油井数n,1£ n£ 10000。接下来n 行是 油井的位置,每行2个整数x和y,-10000£ x,y£ 10000。 « 结果输出: 程序运行结束时,将计算结果输出到文件output.txt 中。文件的第1 行中的数是油井到 主管道之间的输油管道最小长度总和。 输入文件示例 输出文件示例 input.txt output.txt 5 1 2 2 2 1 3 3 -2 3 3 6
    2022-11-12 20:40:04下载
    积分:1
  • 对图像进行非线性调整,可用用图像的增强,特别是模糊图像,增加对比度...
    对图像进行非线性调整,可用用图像的增强,特别是模糊图像,增加对比度-right image nonlinear adjustment can be used to enhance the image, especially fuzzy images, increase contrast
    2022-05-17 22:33:26下载
    积分:1
  • Modbus Master调试软件及其VB编写例程
    Modbus Master调试软件及其VB编写例程-Modbus Master and VB debugging software to prepare routine
    2022-02-24 18:04:41下载
    积分:1
  • Implementation of an Interval Iterative Closest Point that uses intervals to fou...
    Implementation of an Interval Iterative Closest Point that uses intervals to found the global optimal solution. ICP can be used in vision technologies and photogrametry as pattern mathcing and as geometrical model finder. -Implementation of an Interval Iterative Closest Point that uses intervals to found the global optimal solution. ICP can be used in vision technologies and photogrametry as pattern mathcing and as geometrical model finder.
    2022-07-01 17:01:25下载
    积分:1
  • 网吧计费系统软件
    网吧计费系统软件-Internet Billing System Software
    2022-01-28 08:08:43下载
    积分:1
  • 这是一个用C的用来检查内存的工具 很好用
    这是一个用C开发的用来检查内存的工具 很好用-A tool for memory test.
    2022-11-09 13:00:03下载
    积分:1
  • 这是一个关于粒子群算法的程序源码,已经在C++6.0运行过了,真的是不错的一个程序...
    这是一个关于粒子群算法的程序源码,已经在C++6.0运行过了,真的是不错的一个程序-This is a process on the particle swarm algorithm source code, has been run over C++6.0, and really is a good a program
    2023-08-05 04:00:04下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载