控制台刽子手问题 [英] console hangman problem

查看:60
本文介绍了控制台刽子手问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个小程序控制台程序(没有摆动,没有awt,只是控制台)。但是我遇到了一些麻烦,我不确定它是我的逻辑,还是我的代码,或者两者都有?!


无论如何,我现在拥有的东西,我还没有考虑到一个用户通过猜测这个词而获胜。只是努力显示隐藏的单词并根据用户的猜测进行更新。

I am trying to code a little console program (no swing, no awt, just console). But I am having some trouble and I am not sure if its my logic, or my code, or possibly both?!

Anyways heres what I currently have, I have not taken into consideration a user winning by guessing the word yet. Just working on displaying the hidden word and updating it with respect to the users guesses.

展开 | 选择 < span class =codeDivider> | Wrap | 行号

推荐答案

哎呀

whoops

展开 | 选择 | Wrap | 行号



whoops

whoops

展开 | 选择 | < span class =codeLinkonclick =WordWrap(this);> Wrap | 行号


我知道如何轻松地(非雄辩地)将它们添加为字符串。这样做是不正确的?如果不正确,我的程序将失败,此时设计原则不是问题。一旦我有一个工作程序,我总是可以改进。
i knew how to add them easily (not eloquently) as strings. Is it incorrect to do it this way? Incorrect in such away that my program will fail, at this point design principles are not a concern. I can always refine once i have a working program.


这篇关于控制台刽子手问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆