我是一名初级程序员,想用 LC3 汇编设计一个战舰程序

发布于 2024-09-26 05:44:51 字数 36 浏览 2 评论 0原文

我真的不知道如何或在哪里开始我的算法来显示游戏的显示网格。

I don't really know how or where to start my algorithm on showing the display grid for the game.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

红墙和绿瓦 2024-10-03 05:44:51

首先用伪代码设计游戏,这样你就可以弄清楚总体思路(数据结构、算法等)。一旦制定了理论设计,就可以开始编码。

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.

还在原地等你 2024-10-03 05:44:51

最简单的方法是将显示转储为文本字符串:

  0 1 2 3 4 5 6 7 8 9
0 x . B B B B * x x .
1 . . . . . x . . . .    

等等

,然后让地图滚动。

稍后,如果您想变得更有趣,您可以(可能)输出 ANSI 的 ANSI 转义码终端,然后您可以根据需要更新屏幕...老派。

The simplest way would to just dump the display out as strings of text:

  0 1 2 3 4 5 6 7 8 9
0 x . B B B B * x x .
1 . . . . . x . . . .    

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文