我是一名初级程序员,想用 LC3 汇编设计一个战舰程序
我真的不知道如何或在哪里开始我的算法来显示游戏的显示网格。
I don't really know how or where to start my algorithm on showing the display grid for the game.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
首先用伪代码设计游戏,这样你就可以弄清楚总体思路(数据结构、算法等)。一旦制定了理论设计,就可以开始编码。
Design the game in pseudocode first, so that you can get the general ideas worked out (data structures, algorithms, etc). Once you have a theoretical design worked out then you can start coding.
这是一个很好的起点:
http:// /twoguysonebit.com/2010/02/16/code-battleship-game-writing-in-mips-assemble/
Here's a good place to start:
http://twoguysonebit.com/2010/02/16/code-battleship-game-written-in-mips-assembly/
最简单的方法是将显示转储为文本字符串:
等等
,然后让地图滚动。
稍后,如果您想变得更有趣,您可以(可能)输出 ANSI 的 ANSI 转义码终端,然后您可以根据需要更新屏幕...老派。
The simplest way would to just dump the display out as strings of text:
etc.
And let the map scroll.
Later, if you want to get fancy, you can (likely) output ANSI escape codes for an ANSI terminal, then you can just update the screen as you like...old school.