|
|
C ++ hangman - help with one thing?
i have made the program with a human vs computer, but i have to make it against human vs human - how do i go about this oh hers the code for the human and computer---- This looks like Rock Paper Scissors?
In order to make it human v human, you will need to duplicate the code (renaming functions and variables obviously). For the first player, it should save his choice and not display it, and for the second player, it should show his choice and the first players, ie: void display_the_choice (char choice) { char c = tolower(choice); string result; if (c == 'r') result = "Player 1 Chose Rock"; else if (c == 'p') result = "Player 1 Chose Paper"; else if (c == 's') result = "Player 1 Chose Scissors"; } And then, when player 2 makes a choice, then void display_the_choice_p2 (char choice) { char c = tolower(choice); if (c == 'r') cout << result << "Player 2 Chose Rock"<<endl; else if (c == 'p') cout << result << endl << "Player 1 Chose Paper"<<endl; else if (c == 's') cout<< endl << result << "Player 1 Chose Scissors"<<endl; } Any more problems post back! Try posting this question at www.dreamincode.net. They're very helpful and quick!
Your comments suck lol
i think this is not hangman...
What are some simple games, similar to hangman?I have to make a small computer game using Visual Basic for school, and I'm running low on ideas. Some of the othersWhat do a hangman and piano have in common?best answer goes to the person who gets the first correct answer and/or the person who can tell me which graphic novel itCan you figure this out? its like hangman?_ I _ _You _ ARRY _ E It's a Phrase and i CANNOT figure it out Can someone help me with hangman please?_ I_ A _ I have 3 chances left i've used e,o,uHow does the book Year of the Hangman end?i have it for a l.a project/.. and i am 20 pages away frm the ennding but i don'T HAVE TIME TO READ THE REST.Using the program visual express edition 2008 can I design spectrum zx programs? like hangman?hi, I used to design little programs on the spectrum zx like hangmanand i was wondering is it possible to design them Where can I find a free online challenging hangman game with multiple genres?I am looking for a free online hangman games with genres such as pop trivia, music, celebs, tv&movies, or stuff like |
|