I'm trying to create a word game in which a player must guess a secret word.

Initially the secret word it showed as a series of underline characters corresponding to the length of the word to guess



- - -

When a letter entered by the player is correct, the letter replaces the underline character


character entered: 'p'

p_ _

and when put 'i'


and then put 'b'


it is wrong try again

and than put 'g'


how can i make as the two class for this method??

hiddepolen commented: Homework question -1
jwenting commented: lazy homework kiddo -3

Do provide evidence of having done some work yourself if posting questions from school or work assignments