摘要: 本次课题的主要要求学生用汇编语言或c语言编程,设计有21及m根火柴,由计算机与游戏者进行比赛,每次最多拿4根及n根,最少拿1根,谁拿最后1根谁输,要求学生编制程序,使计算机尽可能嬴,并熟练掌握汇编语言或c语言的编程方法。这是个程序设计就在于分块, 把计算机部分,玩家以及界面部分全部设计完,再将它们合并起来。总体来说这不算一个太难的课题,主要的问题就在于算法和逻辑的设计,所以必须动用奥数思想。然后两个火柴堆的问题出来以后,就是原有的基础之上再增加几个参数,类似于数组的模式。例如用四个变量来进行两组火柴堆的计数,例如假设有a,b两堆火柴,我a堆火柴有15根,b堆火柴有17根,玩家取a堆的火柴2根,那么就显示火柴a堆火柴有13根,而b堆有17根,然后电脑从b堆火柴取得火柴如果是3根,那么就显示a堆火柴有13根,而b堆有14根8491
关键词: 计算机游戏;c语言;程序设计;毕业设计;
Computer Game Programming
Abstract: This issue is the major requires students to use assembly language or C language programming, design 21 and m a match, game, computer games each take up to 4 and n roots, at least get one, who took the last 1root, who lost require students of the program causing a computer to win as much as possible, and proficiency in assembly language or c language programming methods. This is the program design lies in the sub-blocks, all finished design part of the computer, the player, as well as part of the interface, and then merge them together. Overall, this is not a difficult subject, the main problem lies in the design of algorithms and logic, it must be utilized Mathematical Olympiad thought. And then out of the two matches heap, is the basis of the original increase the number of parameters, similar to the pattern of the array. E.g. count matches two sets of reactors with four variables, for example, assuming that there is a, b piles of matches, a heap of matches is 15 root 17 root b heap of matches, the first player to take a pile of matches root , then 13 matches a heap of matches and b heap 17, and then the computer from b heap matches if the match is three, then a heap of matches 13 b heap 14. . .
Keywords: computer games; c program language; programming; graduation design
目录
摘要 i
Abstract i
1 绪论 1
1.1 课题内容 1
1.1.1 课题调研 1
1.1.2 相关资料 4
1.1.3 课题分析 10
1.1.4 课题难点 11
1.1.5 代码的格式 11
2 分析 15
2.1 确定软件的功能 17
2.2 定义软件的核心数据结构 17
2.3 对整个软件进行功能模块划分 18
2.4 整个火柴棒游戏的功能介绍 18
3 设计 19
3.1 算法和逻辑分析 19
3.2 玩家先手模块设计 21
3.3 电脑先手模块设计 22
3.4 界面模块设计 25
3.5 两个火柴堆模块设计 26
4 结论 32
4.1 源码 32
4.2 运行结果 44
致谢 48
参考文献 50 计算机游戏两个火柴堆的程序设计:http://www.751com.cn/jisuanji/lunwen_6693.html