Can anyone give code for hangman game, is it difficult to create? | Sololearn: Learn to code for FREE!

+1

Can anyone give code for hangman game, is it difficult to create?

C++, game

c++

10/5/2016 6:52:09 AM

red watson

1 Answer

New Answer

0

That's quite simple. I cannot give you the code because I haven't read the "string" chapter yet. But this is the method I thought: 2 strings A,B, one for the inserted word and one for the result one. CIN the A string WHILE loop with a BOOL X=0 condition ( X=1 CIN a C CHAR I=0 WHILE the ([I] char of string A) != '\n' ( IF this characters = C, then write it to the ([I] position of string B) and substitute it on string A with a symbol (for example #) ELSE IF it's != '#', then X=0 I++ ) Print string B ) Then you can add messages, a counter for tentatives, etc... If you don't understand something, please tell me.