You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
561 B
25 lines
561 B
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <time.h>
|
|
#include <math.h>
|
|
|
|
int game(char you, char computer)
|
|
{
|
|
if (you == '1' && computer == '1')
|
|
return -1;
|
|
if (you == '2' && computer == '2')
|
|
return -1;
|
|
if (you == '3' && computer == '3')
|
|
return -1;
|
|
if (you == '2' && computer == '3')
|
|
return 0;
|
|
else if (you == '3' && computer == '2') return 1;
|
|
if (you == '2' && computer == '1')
|
|
return 1;
|
|
else if (you == '1' && computer == '2')
|
|
return 0;
|
|
if (you == '3' && computer == '1')
|
|
return 0;
|
|
else if (you == '1' && computer == '3')
|
|
return 1;
|
|
}
|