0% found this document useful (0 votes)
274 views10 pages

ROCK PAPER SCISSORS USING C.PDF 01

Uploaded by

madhukallali8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
274 views10 pages

ROCK PAPER SCISSORS USING C.PDF 01

Uploaded by

madhukallali8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

ROCK PAPER SCISSORS USING C

TEAM:
MADHUSUDANA (N-39)
LAVANYA G (N-33)
PADMINI S (N-54)
INTRODUCTION:-

❖ Rock paper scissors (also known by other orderings of the three


items,
• with "rock" sometimes being called "stone," or as Rochambeau,
roshambo,
• or ro-sham-bo is a hand game, usually played between two people, in
• which each player simultaneously forms one of three shapes with an
• outstretched hand.
• ❖ These shapes are "rock" (a closed fist), "paper" (a flat hand), and
• "scissors" (a fist with the index finger and middle finger extended, forming
• a V). The earliest form of "rock paper scissors"-style game originated in
• China and was subsequently imported into Japan, where it reached its
• modern standardized form, before being spread throughout the world in
• the early 20th century.
• ❖ Rock paper scissors is often used as a fair choosing method between
two
• people, similar to coin flipping, drawing straws, or throwing dice in order to
• settle a dispute or make an unbiased group decision. Unlike truly random
• selection methods, however, rock paper scissors can be played with a
• degree of skill by recognizing and exploiting non-random behavior in
• opponents.
ACKNOWLEDGEMENT

We would like to extend my gratitude to the principal Sir “Dr.Sanjay jain” and
vice principal sir “Dr.B.Narasimha murthy” and also our HODs
“Dr.Raveesha K H” and “Dr.Fazlur Rahaman” for providing us with all the
facility that was required for this project we would like to express our special
thanks of gratitude to our beloved teachers and seniors for their able
guidance and support in completing our project.

GROUP MEMBERS:
• MADHUSUDANA(N-39)
• LAVANYA G(N-33)
• PADMINI S(N-54)
DECLARATION BY THE CANDIDATES
• We hereby declare that that the project entitled “ROCK PAPER
SCISSORS using C programming” is an outcome of our own efforts
under the guidance of our seniors.
• This project is submitted to CMR Institute of technology .
PROGRAMME CODE :-
#include <stdio.h>
#include <conio.h>
int you, computer; // GLOBAL DECLARATION
int
menu ()
{
int ch;
printf ("\n1.select ROCK ");
printf ("\n2.select PAPER ");
printf ("\n3.select SCISSOR ");
printf ("\n4.EXIT");
printf ("\n ENTER YOUR CHOICE : ");
scanf ("%d", &ch);
return (ch);
}
void
setup ()
{
label:
computer = rand () % 4;
if (computer == 0)
goto label;
you = menu ();
}
void
makelogic ()
{
switch (you)
{
case 1: //YOU = ROCK ,COMPUTER =ROCK
if (computer == 1)
{
printf ("\n GAME DRAW ");
printf ("\n you=rock \n computer = rock");
}
else if (computer == 2)
{ // you = rock ,computer = paper
printf ("\n you = rock\n computer = paper ");
}
else //you=rock ,computer = scissor
{
printf ("\nYOU WON");
printf ("\n you = rock \n computer = scissor");
}
break;
case 2: //YOU = paper ,COMPUTER =ROCK
if (computer == 1)
{
printf ("\n YOU WON ");
printf ("\n you = paper \n computer = rock");
}
else if (computer == 2) // you=paper ,computer =paper
{
printf ("\n GAME DRAW ");
printf ("\n you = paper \n computer = paper ");
}
else //you=paper,computer = scissor
{
printf ("\n COMPUTER WON ");
printf ("\n you = paper \n computer = scissor");
}
break;
case 3:
if (computer == 1) // you=scissor ,computer =paper
{
printf ("\n COMPUTER WON ");
printf ("\n you = paper \n computer = rock");
}
else if (computer == 2) // you=scissor ,computer =paper
{
printf ("\n YOU WON ");
printf ("\n you = paper\n computer = paper");
}
else //you=scissor ,computer = scissor
{
printf ("\n DRAW ");
printf ("\n you = paper \n computer =scissor");
}
break;
case 4:
break;
default:
{
printf ("\n invalid user CHOICE ;");
}
}
}
int
main ()
{
while (1)
{
system ("cls");
setup ();
makelogic ();
getch ();
}
return 0;
}

OUTPUT:
Conclusion :-
❖ This concludes the C programming lesson.
❖ We hope this will be entertaining and enjoyable playing with
it.

******Thank you*******

You might also like