codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#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"; } } }
Private
[
?
]
Run code
Submit