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

example:

“pig”

- - -


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

example:


character entered: 'p'


p_ _


and when put 'i'

pi_


and then put 'b'

pi_

it is wrong try again


and than put 'g'

pig


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