Professional Documents
Culture Documents
Rock, Paper&Scissors
Rock, Paper&Scissors
h>
#include<stdlib.h>
#include<time.h>
#include<stdio.h>
#include<conio.h>
void main()
{clrscr();
int a,b=0,c=0;
char d,e;
cout<<"\n"<<"\n"<<"\n";
cout<<"
wel to rock paper scissors
by mdc
";
cout<<"\n"<<"\n"<<"\n"<<"da rulz r.....:-";
cout<<"\n"<<"r-rock"<<"\n"<<"sscissors"<<"\n"<<"p-paper"<<"\n";
cout<<"rock cancels scissors"<<"\n"<<"paper
cancels rock"<<"\n"<<"scissors
cancels paper"<<"\n";
cout<<"\n"<<"choose the char u want to &
press the relevant button";
for(int i=0;i<7;i++)
{cout<<"\n"<<"\n"<<"so here v go....rock....
paper.... scissors (enter now) ";
cin>>d;
if(d!='r'&&d!='s'&&d!='p')
{cout<<"asshole enter either r p or s";
b++;
cout<<"\n"<<"the scores r..."<<"\n";
cout<<"
comp :- "<<b<<"
yourselves :"<<c;
}
else
{
randomize();
a=(rand()%13);
if(a==1||a==4||a==7||a==10)
e='r';
else
{if(a==2||a==5||a==8||a==11)
e='p';
else
e='s';
}
cout<<"the comp has chosen...... "<< e;
if(d=='r')
{if(e=='r')
cout<<"\n"<<"draw"<<"\n";
cout<<"the scores r..."<<"\n"<<"
"<<b<<" yourselves :- "<<c;
else
{if(e=='p')
comp :-