1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
#include <cstdlib>
#include <iostream>
#include <ctime>
using namespace std;
// Function list
void choice(int computerChoice);
void statement(int uScore , int Score , int uChoice, int Choice);
void counter(int uScore, int Score);
int main(int argc, char *argv[])
{
int uChoice;
int Choice;
int uScore = 0;
int Score = 0;
// display the Menu
do
{
cout << " Enter your choice: ";
cin >> userChoice;
if (userChoice == 1)
{
cout << " You selected: Rock" << endl;
}
else if (userChoice == 2)
{
cout << "You selected: Paper" << endl;
}
else if (userChoice == 3)
{
cout << "You Selected: Scissors" << endl;
}
// Control user input
if (uChoice > 3)
{
cout << "\n Please choose rock , paper , or scissors" << endl;
}
else if (uChoice < 1)
{
cout << "\n Please choose rock , paper , or scissors \n" << endl;
}
// Function for computers choice
choice(int Choice);
// Function for Win/Lose statement
statement(int uScore, int Score, int uChoice, int Choice);
// Function for score counter
counter(int uScore, int Score);
}
while (uScore != 10||Score != 10);
system("PAUSE");
return EXIT_SUCCESS;
}
void choice(int Choice)
void statement(int uScore, int Score, int uChoice, int Choice)
// Score couter dispaly
void counter(int uScore, int Score)
|