I\'m stuck on a java assignment for a class where we need to make a Hangman game but a REALLY BASIC one (It\'s an intro to Java class). Basically I have a word entered by someon
It's not so stupid, the aim is to make you more able to come up with original solutions.
Here, for example, you are working with Strings, so it would make sense to go on the javadoc and see the String page, to see if any function could come handy.
Next, comes the logic : you get a "String" input, then only get "char"s input and you have to compare a String with a char. So, the best way is to compare each "char" of your "String".
You can't use arrays ? Ok then, you can also use loops and two certain String functions (you already knows length(), which is one of the two), which will give the same result as going through a array to test each of its element.
The game end if no * is displayed or if there is no attempts left, so the player can try as long as neither of those conditions are true.