I'm giving you a working version, albeit minimalistic, of your code. Note there aren't global variables (they are evil).
#include <stdio.h>
const char Rock = 'r';
const char Scissors = 's';
const char Paper = 'p';
char get_input(int player_no)
{
while (1)
{
printf("Player %d, please enter Rock (r) Paper (p) or Scissors (s):\n", player_no);
char choice = getchar();
getchar(); if ( (choice == Rock) || (choice == Scissors) || (choice == Paper))
return choice;
}
}
int winner_number( char p1_choice, char p2_choice)
{
if ( (p1_choice==Rock && p2_choice==Scissors) || (p1_choice==Scissors && p2_choice==Paper) || (p1_choice==Paper && p2_choice==Rock))
{
return 1;
}
else if ( (p1_choice==Rock && p2_choice==Paper) || (p1_choice==Paper && p2_choice==Scissors) || (p1_choice==Scissors && p2_choice==Rock) )
{
return 2;
}
return 0;
}
int main()
{
char answer;
do
{
char p1_choice = get_input(1);
char p2_choice = get_input(2);
int winner = winner_number( p1_choice, p2_choice);
if ( winner == 0)
printf("it is a draw\n");
else
printf("the winner is player %d\n", winner);
printf("do you wish to continue?\n");
answer = getchar();
getchar(); } while ( answer == 'y');
return 0;
}