#include<bits/stdc++.h>
#include<windows.h>
#include<time.h> 
#include<conio.h>
#include<stdio.h>

using namespace std;
int flag[3]={1,1};
void Slowsay(string a){
	int l=a.size();
	for(int i=0;i<l;i++){
		cout<<a[i];
		Sleep(10);
	}
	printf("\n");
}
void Color(int a)
{
	if(a==0) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
	if(a==1) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN|FOREGROUND_BLUE);
	if(a==2) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN);
	if(a==3) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE);
	if(a==4) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED);
	if(a==5) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN);
	if(a==6) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_BLUE);
	if(a==7) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN);
	if(a==8) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
	if(a==9) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|BACKGROUND_INTENSITY|BACKGROUND_RED);
	if(a==10) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN|FOREGROUND_BLUE|BACKGROUND_INTENSITY|BACKGROUND_BLUE);
}

void gameboard(int x){
	Color(6);
	cout<<"玩家"<<x<<endl;
	Sleep(500);
	Color(1);
	Slowsay("1:石头\n2:剪刀\n3:布");
	Color(8);
	return;
}
void game(){
	int answer;
	int timeup=5;
	int s1,s2;
	char choose;
	while(1){
		
		system("cls");
		Slowsay("请玩家2离开屏幕");
		Sleep(1500);
		
		system("cls");
		gameboard(1);
		cin>>s1;
		system("cls");
		
		
		Slowsay("请玩家2来到屏幕");
		Sleep(1500);
		
		system("cls");
		gameboard(2);
		cin>>s2;
		system("cls");
		
		Color(2);
		system("cls");
		if((s1==1&&s2==2)||(s1==2&&s2==3)||(s1==3&&s2==1)){
			Slowsay("玩家1win");
		}else if((s2==1&&s1==2)||(s2==2&&s1==3)||(s2==3&&s1==1)){
			Slowsay("玩家2win");
		}else{
			Slowsay("平局"); 
		}
		Sleep(3000);
	}
	return ;
}
int main(){
	game();
	return 0;
}