摘 要:Linux系统不仅免费、开源,而且还安全稳定,通过学习简单的指令让程序员更快地入门,让大家早一点接触Linux系统,并用 C 语言进行简单的贪吃蛇游戏设计。贪吃蛇是许多人小时候的经典回忆,在对贪吃蛇游戏编写时会涉及地图,食物,蛇的更新,文章是基于Linux系统通过使用C语言进行蛇游戏的设计与编写,经过每一个功能的设计与测试一步一步地最终实现游戏呈现的效果。
关键词:Linux 系统;C 语言;ncurses 库;结构体;线程
DOI:10.19850/j.cnki.2096-4706.2022.01.025
中图分类号:TP311 文献标识码:A 文章编号:2096-4706(2022)01-0093-04
Snake Game in C Language Based on Ncurses Graphics Library for LINUX System
SUN Jicheng
(Inner Mongolia University of Technology, Hohhot 010080, China)
Abstract: The Linux system is not only free and open source, but also safe and stable. By learning simple instructions, programmers can get started faster, so that everyone can get in touch with the Linux system earlier, and use C language to design a simple snake game. Snake game is a classic memory of our childhood. When writing the snake game, it will involve the update of maps, food, and snakes. This paper designs and writes the snake game based on the Linux system by using C language. After the design and test of each function step by step, it finally achieves the effect of the game presentation.
Keywords: Linux system; C language; ncurses library; structure; thread
参考文献:
[1] 李雨哲,孙炼 . 基于 C 语言的贪吃蛇游戏设计 [J]. 河南科技,2020(7):31-33.
[2] 张文华,廖俊杰,付乙眉 . 基于 C 语言的贪吃蛇游戏的简单设计与实现 [J]. 智富时代,2019(3):183.
[3] 王思乐,卢素魁,杨文柱,等 . 链表结构在基于 C 语言项目中复用方法 [J]. 电脑编程技巧与维护,2017(20):9-10+13.
[4] 匡泰,时允田 .C 语言程序设计项目式教程 编程语言 [M].北京:人民邮电出版社,2017.
[5] 周小云 .C 语言的快乐教学之旅 [J]. 课程教育研究,2013(2):156.
作者简介:孙继承(2000—),男,汉族,内蒙古呼伦贝尔人,本科在读,研究方向:计算机。