因此,这些参数都不起作用。我尝试编译它,但两者都收到相同的错误消息:
unexpected type
required: variable
found : value
if(word.charAt(val) = guess)
^
然而,克拉指向括号,所以我不确定它的参数错误。我看了大约 15 个网站,他们都说应该是 0 到 1 之间的整数,小于单词的长度
int val = 0;
if(word.indexOf(guess) > 0 )
{
if(word.charAt(val) = guess)
{
screentxt[val] = guess;
}
if(word.charAt(0) = guess)
{
screentxt[0] = guess;
}
}