#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
int main() {
// constant declarations
const char ROCK = 'R,r';
const char PAPER = 'P,p';
const char SCISSORS = 'S,s';
char playerInput;
const string P1_WINS = "Player one wins!";
const string P2_WINS = "Player two wins!";
const string ROCK_BEATS_SCISSORS = "Rock beats scissors.";
const string SCISSORS_BEATS_PAPER = "Scissors beats paper.";
const string PAPER_BEATS_ROCK = "Paper beats rock";
// print heading
cout << "Welcome one and all to a round of Rock, Paper Scissors! (Enter P, R or S)." << endl;
cout << "Player 1:";
cin >> playerInput;
cout << "Player 2:";
cin >> playerInput;
This post has been edited by no2pencil: 31 January 2012 - 12:21 AM
Reason for edit:: Added code tags

New Topic/Question
Reply



MultiQuote







|