4 Star 2 Fork 0

史振宁 / Mine_pro

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or Download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

Mine_pro

开发环境

Development Environment

DOSBOX-X,TASM/MASM

介绍

Intruduction

这是一个用汇编语言实现扫雷小游戏的项目
This is a compilation project used to realize the minesweeping game

作者信息

Author Information

史振宁、唐果、赖雨桐、杜苗增
Shi Zhenning, Tang Guo, Lai Yutong, Du miaozheng

预计提交时间

Estimated Submission Time

12.15

心得体会

Experience

本次开发经历了三次迭代:

  1. 第一次迭代完成了总体代码框架的布局,在图形界面方面采用了按像素点画图,发现效率太低,于是有了第二次迭代
  2. 第二次迭代采用了文本方式画图,效率大大提高,同时完成了主要宏和过程的编写,但是在编写过程中有很多宏和过程使用数据据结构低效,部分代码反复重用,于是乎进行了第三次迭代
  3. 第三次迭代重写了低效的宏和过程和复用的代码段,大大提升了算法效率和减少了代码长度,增加了模块间的低耦合和模块内功能的高内聚,同时增加了鼠标键入和声音功能,完善了用户体验

This development has undergone three iterations:

  1. In the first iteration, the layout of the overall code framework was completed, and the drawing by pixel was adopted in the graphical interface. It was found that the efficiency was too low, so there was the second iteration
  2. The second iteration adopts text drawing, which greatly improves the efficiency, and completes the preparation of main macros and processes. However, in the preparation process, many macros and processes use inefficient data structure, and some codes are reused repeatedly, so the third iteration is carried out
  3. The third iteration rewrites inefficient macros and processes and reused code segments, greatly improves the algorithm efficiency and reduces the code length, increases the low coupling between modules and high cohesion of functions within modules, increases the mouse typing and sound functions, and improves the user experience

图片展示

Image Show

image
image
image
image
image
image
image
image
[演示视频]

一些技巧

  1. 在编写每个模块时,应当先设计测试单元,完成测试后再放入主结构进行合并,可以有效避免之后在主结构中出现问题后冗长的DEBUG悲剧
  2. 编写宏时,应当尽量避免出现循环和标记,以防止反复调用出现的标签重复;若一定要反复使用循环,请编写过程
  3. 编写宏和过程时,应当先将不需要改变的寄存器入栈,之后出栈,防止误改变了本不该改变的寄存器
  4. 在编写跳转语句时,因为JCC语句的跳转长度十分有限,很多情况下先JCC跳转到一个很近的标记处作为中转,再从这个中转使用JMP语句跳转到真正的标记处
  5. 原型开发可以舍弃之前的思维定势,有效提高编码效率

Tips

  1. When writing each module, the test unit should be designed first, and then put into the main structure for merging after completing the test, which can effectively avoid the lengthy debug tragedy after problems occur in the main structure
  2. When writing macros, loops and tags should be avoided as far as possible to prevent repeated calling of tags; If you must use loops repeatedly, write a procedure
  3. When writing macros and procedures, the registers that do not need to be changed should be put on the stack first and then out of the stack to prevent the registers that should not be changed from being changed by mistake
  4. When writing jump statements, because the jump length of JCC statements is very limited, in many cases, JCC jumps to a very close mark as a transit, and then uses JMP statements to jump from this transit to the real mark
  5. Prototype development can abandon the previous thinking set and effectively improve coding efficiency

Repository Comments ( 0 )

Sign in to post a comment

About

This is a compilation project used to realize the minesweeping game expand collapse
Assembly and 2 more languages
MulanPSL-2.0
Cancel

Releases (5)

All

Contributors

All

Activities

Load More
can not load any more
Assembly
1
https://gitee.com/shi-zhenning/Mine_pro.git
git@gitee.com:shi-zhenning/Mine_pro.git
shi-zhenning
Mine_pro
Mine_pro
master

Search