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??

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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.