[ create a new paste ] login | about

Link: http://codepad.org/XCh8LZC1    [ raw code | output | fork ]

pjvangemmeren - C++, pasted on Nov 18:
#include <iostream>
using namespace std;

int choice1;
char choice2;
char variableChoice3;
char computerChoice;

int main ()
{
    cout << "\t\tWelcome to the rock, paper, scissors program!\n";
    rand (1 + 1%3) >> computerChoice;
    if (computerChoice == r)
    {
        if (choice2 == r)
        {
            cout >> "Tie";
        }
        if (choice2 == p)
        {
            cout >> "You win";
        }
        if (choice2 == s)
        {
             cout >> "You lose";
        }
    }
    if (computerChoice == p)
    {
        if (choice2 == r)
        {
            cout >> "You lose";
        }
        if (choice2 == p)
        {
            cout >> "Tie";
        }
        if (choice2 == s)
        {
            cout >> "You win";
        }
    if (computerChoice == s)
    {
        if (choice2 == r)
        {
            cout >> "You win";
        }
        if (choice2 == p)
        {
            cout >> "You lose";
        }
        if (choice2 == s)
        {
            cout >> "Tie";
        }
    }
}


Output:
1
2
3
In function 'int main()':
Line 470: error: too many arguments to function 'int rand()'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: