|
|
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...
Where can i find an online HANGMAN game for my 6 year old son with easy words?I found a site today that i thought was suitable but the first word was ejaculation...i don't think very suitable forThe Hangman in the poem and the scaffold in the poem are symbolic of Hitler and his rise to power?1. Explain how the Hangman and the scaffold represent Hitler and his rise to power.2. Explain the poem when the I'm playing hangman and i need help with this phrase?B A T T L E / _ _ _ N / O _ / T _ E / R E _ _ _ _ _ _Letters that are not in there are: J and S. thanks :) What was the song at the end of the Numb3rs episode Hangman? (Season 6)?["Body shed not a breath too soon, never said it was good never said it new... etc"]. I really want to find thisIf I were a grave digger or even a hangman, there are some people I cld work for with a great deal of enjymt?Need some Hangman Words?Need few (around 10) good hangman words along with clues that we can give for them. Thanks in advance.In java a & ab ap edition does anyone have the solutions to hangman in chapter 10?I really need this assignment done and I cant figure it out |
|