Spring 2019 Third course experiment report

I: Experimental Project Name: Snake

     二:实验项目功能描述:
       随机产生一条类似于“蛇”的蛇,可以通过wasd四键操作使其移动一旦在一条直线上移动就不能突然向其它的反方向移动,这样马上就游戏结束。

Or its head touches the top of each, also touched upon the game is over.
III: project module structure description
(1) void gotoxy (int x , int y) of hiding a pointer function
(2) Void moveSnackByDirection () changes the definition of snake direction of movement
(3) void startup () game data initialization
(4) void show () display screen
(5) void updateWithoutInput () automatic operation system
(6) void updateWithInput () function is operated by the player

     四:实现界面展示

     五:代码托管链接:
     https://gitee.com/dadandan/chen/commit/2ecb116084ea4cc517d9560021cb1000785f4003
    
     六:实验总结:

One: For this Snake I was a little reaction, however, it is the use of an array of several representatives of what I know, but the number kept inside the change over the past little change makes me uncomfortable, so do not let me What point more than the increase in this game.
Two: the transformation code is too sudden, meaning that I know are doing, but they think all of a sudden there, or to practice much, ah, or have nothing to learn, the last few weeks, come on!

Guess you like

Origin www.cnblogs.com/chenxinxin/p/10988824.html