> Hey guys, I'm new to j2me and I would like to develop a hangman game are
> there any tutorials available online to tech me specifically how to do
> this.
>
> Salim
I'll lay it out for you:
You take a given word (maybe when you start the program it accepts the
word as input)
The main program is a simple loop of accepting guesses until either the
user runs out of guesses (is hung) or guesses all the correct letters.
In the loop:
You accept a character as a guess
If the character exists in the word
show it was a correct guess
(display the character within hidden word for example)
else
decrease the number of guesses
(display part of the gallows if desired)
I did a solution in about 15 minutes. I read the word into an array of
char. I had another array of char of the same length which shows the
progressively revealed word (e.g. if the word was "hello" then it
initially displayed as "-----". If the person chose the letter "l" then it
became "--ll-".) When I check a guess, I simply look for the guessed
character in the first array of char (by looping over it) and in each
location I found it, I'd note the index and update the 2nd array of char
with the (correctly) guessed character at the same index. When the two
arrays are equal, then the game is finished (if you haven't run out of
guesses first).
Make an attempt and post it if you want more help.
Cheers

Signature
Sean
"I love deadlines. I love the sound they make as they Whoosh by" -
Douglas Adams
--------
|
O
/|\
/\
> Hey guys, I'm new to j2me and I would like to develop a hangman game
> are there any tutorials available online to tech me specifically how to
> do this.
>
> Salim
Fahd Shariff - 08 Mar 2005 09:58 GMT
I think Salim wanted some pointers on developing this as a J2ME
application. I'm sure he could have handled the implementation of the
hangman game himself.

Signature
Fahd Shariff
"Let the code do the talking... "
Salim - 10 Mar 2005 11:36 GMT
Yes Fahd, Exactly that, thats why i'm asking if there are any
tutorials to give me a few pointers and teach me at the same time.
I'M NOT ASKING TO BE 'SPOON FED'!!!!!
Salim
> I think Salim wanted some pointers on developing this as a J2ME
> application. I'm sure he could have handled the implementation of the
> hangman game himself.