拼字游戏模拟Java程序帮助 [英] Scrabble Simulation Java Program Help

查看:155
本文介绍了拼字游戏模拟Java程序帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿大家,

为了设置练习12.15,我不确定如何做到这一点。最初我计划在字母表中添加另一个值来表示通配符,然后单独执行if循环,如果发生这种情况,但我意识到不是一个字符,所以它不起作用。你能告诉我如何进行这项练习12.15吗?



这是练习:



练习12.15。在真正的拼字游戏中,有一些空白牌可以用作外卡的
;也就是说,空白图块可用于表示任何字母。

想想canSpell处理通配符的算法。将它实现到你的代码中。

Hey everyone,
For setting up Exercise 12.15, I was unsure how to do this. Originally I planned to add another value of " " to alphabet to represent wild card, and then do a separate if loop for if this occurred but I realized " " is not a character so it doesn't work. Can you give me an idea of how to perform this exercise 12.15?

Here is the exercise:

Exercise 12.15. In real Scrabble, there are some blank tiles that can be
used as wild cards; that is, a blank tile can be used to represent any letter.
Think of an algorithm for canSpell that deals with wild cards. Implement it into your code.

推荐答案

我不知道你在哪里遇到问题。请更新你的问题以解决具体问题。

但是当我试图通过复制上面的代码来解决错误时,似乎你已经在程序的最后添加了}。当我删除它时,输出变为true。

我认为这是你的Boolean.Hope的输出。这有帮助。
I don't know where you have a problem.Please update your question with a specific problem.
But when I tried to solve the error by copying your code above it seems that you have additionally added "}" at the last of your program .when I removed it, the output comes "true" .
I think this is the output of your Boolean.Hope this helps.


请检查你的括号!这似乎是问题
please check your brackets! that seems to be the issue


这篇关于拼字游戏模拟Java程序帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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