Hello everyone, im just having some problem forming a script for a hangman script. The question states:
The object this excercise is for u to write a script that emulate the classic game hangman. The object of this game is for a user to try and guess a word which has been generated by the program. The user will generally have a certain amount of lives and is then requested to try and guess a letter in the owrd. on successful guesses the letter is shown within the word in its relevant position. An unsuccessful guess leads to a loss of a life. A reord of guessed letters must be kept and displayed.
Specification
1) The program will allow for a 1 player game. The word to be guessed is randomly generated from a list of stored words.
2)The guessed letters must be visible to the player.
3)The current lives must be visible
4)The number of guesses must be visisble
5)When the number of lives has run out or the word is guessed a mesage should be displayed to the user stating how they ahve done.
Example..
Sorry the word was "THE_SECRET_WORD"
OR
Well done the word was "THE_SECRET_WORD" you guessed it in 15 attempts with the loss of 2 lives
6) you must prompt te er to ask if they wish to play again.
7)your application should prevent the user entering characters other than letters. the user should only be able to enter one letter at a time.
If anyone could post how i could overcome this problem it would be great, if some one could have a crack at this and maybe post syntax i would be really please. Many Thanks in advance.