基于 C 语言的拼图游戏设计
摘 要:近年来随着科技的飞速发展,C 语言的应用正在不断深入。C 语言目前是国际上比较流
行的计算机高级编程语言之一,因其简洁、使用方便且具有强大的功能而受到编程人员的普遍
青睐。它既适合作为系统描述语言,也可用来编写系统软件,还可以用来编写应用软件和设计
游戏等。本文着重分析 C 语言实现一个简单的拼图游戏,旨在介绍拼图游戏的实现方法。编程
工具 Turbo C。涉及内容:TC 图形库的使用、随机数的产生、光标定位。
关键词:C 语言;拼图;Turbo C;图形库
中图分类号:TP3 文献标识码:A
Puzzle Game based on the C Language
Peng Yun-yi
(Chengdu University of Information Technology, Sichuan Chengdu, China, 610225)
Abstract:With the rapid development of science and technology in recent years,C
language,applications are continuously in depth.C language is now more popular internationally in high-
level computer programming language,one of its simplicity,easy to use and with powerful features
favored by ordinary programmers.It is suitable as a system description language,can also be used to write
system software,application software can also be used to write system software,application software can
also be used to write and design games.This title focuses on the analysis of C language to achieve a
simple jigsaw puzzle, puzzle game designed to introduce realization method. Programming tool Turbo C.
Content: use of the TC graphics library, random number generation, and positioning the cursor.
Keywords:C language;Puzzle;Turbo C;graphics
目录
1.1 设计的功能......................................................................................................................................2
1.2 游戏编程思想..................................................................................................................................2
2.3 函数功能描述..................................................................................................................................4
3.1 源码分析...........................................................................................................................................4
3.1.1 程序预处理...........................................................................................................................4
3.1.2 初始化模块...........................................................................................................................4
}......................................................................................................................................................6
3.1.3 画图模块...............................................................................................................................6
3.1.5 主函数...................................................................................................................................7
初始
化模
块
按键
模块
交换
模块
图形
打印
模块
拼图游戏