I'm sorry, but I don't know much about when and when not to use boolean. This is what I have so far
package test;
import java.util.Scanner;
import java.util.Random;
public class Test {
Type: Posts; User: tonynsx
I'm sorry, but I don't know much about when and when not to use boolean. This is what I have so far
package test;
import java.util.Scanner;
import java.util.Random;
public class Test {
I'm trying to count the number of times the user guesses the wrong character
Yes, the count should be incremented by 1 anytime the user guesses the wrong character
How can I implement the...
With out those two lines, my guess won't show up in the dash[]. It will display just -------
I removed the second line, dash[word.indexOf(guess.charAt(0))] = check;, and it still works, so I guess...
Solved
Java Platform SE 7
Here's the working code, what I did was, I converted the char dash[] into a new String (test), and just compared two string with .equals(). Now time to work on the...
Sir, thanks for your help so far. I have to go to class now, so I'll let you know if I figure something out.
Tony
I've made some modification.
if(word.charAt(b) == dash[b])// currently working on this, make an array to store guesses?
{
// dash[b] =...
I did look, but I can't figure out what's going on.
--- Update ---
I have Java class tomorrow, and I'll ask my professor to look at my code if I can't figure it out.
What I meant was, moving the if condition outside of the for loop did the same thing.
No sir, I'm sorry. I still have the original problem.
So what should I do to fix it?
I don't understand what I'm doing wrong. Logically, I'm comparing each index of dash[] with word.charAt(b), so it should work.
--- Update ---
I've put...
This is the code with compiler error:
package test;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Random;
public class Test {
dashArray[b] == (word.charAt(b) I tried to do it like that, but it's giving me a syntax error, so I can't compile it.
" " + dashArray[b] == ("" + word.charAt(b) I tried this way, compiles but,...
I did a system.out to see the actual values each time, and as you can see, even when dash[b] = elephant, and the word.charAt(b) matches it, it's still waiting for me to enter something instead of...
I'm trying to figure out how to let the dash[] know the player entered all the correct letters to solve the game. It knows the correct word was guessed, the first part of the if condition...