I have a non-marked brainstorming exercise to do which is related to a further marked coursework which will be similar but more complex. The task for the non-marked text-based Hangman is basically to create a JavaScript Hangman game that uses any of the four random words:
var words =["programming", "practical", "software", "development"];
The program should start by telling the user "Guess the word: _______ ;
now the underscores represent the word to be guessed, which has to be one of the four above.
The programm then asks the user to enter a letter, if it's right, the user will be told he still has 'ten go's' at the game and fills out one of the underscores. If not the user is told he is left with 9 go's and the underscores remain as they are.
I know how to ask the user for input - I am just really, really confused as to how to create the part of the programm where the 'Guess the word: _____-'
is changed to "Guess the word: __I___"
as for example.
What method do I have to use here? Any suggestions or generic examples would be really helpful! Thanks a ton!