uno卡牌c++实现(+4,change color未完成)

#include<windows.h>
#include<conio.h>
#include<wincon.h>
#include<string>
#include<vector>
#include<algorithm>
#include<ctime>
#include<cmath>
#include<iostream>
#include<map>
#pragma GCC optimize(3)
using namespace std;
const int most=11,begin_n=10;
struct pai{
    
    
	string name;
	int color;
} shang,begin;
vector<pai> a[25];
struct all{
    
    
	string all_name;
	int color,number;
} b[1+13*4+2];
string Color,Name,beginNames[3]={
    
    "stop","back","+2"},gnp[5]={
    
    "stop","back","+2","+4","change color"},alltyps[15]={
    
    " ","1","2","3","4","5","6","7","8","9","stop","back","+2","+4","change color"},allcolors[4]={
    
    "blue","green","red","yellow"};
long long ej=1;
int z,e,f,colors[5]={
    
    0,1,2,4,6},flag,place,beginColors[4]={
    
    1,2,4,6};
bool players[1000];
const char* help[21]=
{
    
    "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓    ",
 "│            帮助             │    ",
 "│     按下'<-'键,上一张牌     │    ",
 "│     按下'->'键,下一张牌     │    ",
 "│    按下'Esc'键,退出游戏     │    ",
 "│   按下'Enter'键,确认下牌    │    ",
 "│       按下's'键,设置        │    ",
 "┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫    ",
 "│            规则             │    ",
 "│   游戏开始,程序会自动为每人 │    ",
 "│随机发6张牌。                │    ",
 "│   每次出牌时,如果牌中有和上 │    ",
 "│一次一样的数字,有和上一次一样│    ",
 "│的颜色,有+4或change color就可│    ",
 "│以出满足条件的牌否则,程序就会│    ",
 "│随机为你抽取一张牌(可以选择, │    ",
 "│在设置中更改)。              │    ",
 "│    遵循以上规则,谁的牌先下完│    ",
 "│谁就赢了(注:但如果自己的牌超│    ",
 "│过了11张,那会直接退出)       │    ",
 "┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛    "};
const char* help2[21]=
{
    
    "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓    ",
 "│            帮助             │    ",
 "│                             │    ",
 "│  按下任意字母键,下一张牌   │    ",
 "│                             │    ",
 "│    按下'Enter'键,确认      │    ",
 "│                             │    ",
 "┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫    ",
 "│            规则             │    ",
 "│   游戏开始,程序会自动为每人 │    ",
 "│随机发6张牌。                │    ",
 "│   每次出牌时,如果牌中有和上 │    ",
 "│一次一样的数字,有和上一次一样│    ",
 "│的颜色,有+4或change color就可│    ",
 "│以出满足条件的牌否则,程序就会│    ",
 "│随机为你抽取一张牌           │    ",
 "│    遵循以上规则,谁的牌先下完│    ",
 "│谁就赢了                     │    ",
 "│                             │    ",
 "│                             │    ",
 "┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛    "};
int Cards_Shape[10][19][30]={
    
    
{
    
    {
    
    0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0},
 {
    
    0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,0,1,1,1,1,0,0,0,0,0},
 {
    
    0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,1,1,1,1,0,0,0,0,0},
 {
    
    0,0,0,0,0,1,1,1,1,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,0,0},
 {
    
    0,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0},
 {
    
    0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,0,0,1,1,1,1,0,0,0,0,0},
 {
    
    0,0,0,0,0,1,1,1,1,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0},
 {
    
    0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,0,0,1,1,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0}},
{
    
    {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,0,0,1,1,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0}},
{
    
    {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,0,0,1,1,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0}},
{
    
    {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,0,0,1,1,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0}},
{
    
    {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,0,0,1,1,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0}},
{
    
    {
    
    0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,0,0,1,1,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0}},
{
    
    {
    
    0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,0,0,1,1,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0}},
{
    
    {
    
    0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,0,0,1,1,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0}},
{
    
    {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,0,0,1,1,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0}},
{
    
    {
    
    0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,0,0,1,1,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0}}
};
int Cards_Shape2[3][19][30]={
    
    
{
    
    {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0},
 {
    
    0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0},
 {
    
    0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0},
 {
    
    0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,0,0,1,1,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0}},
{
    
    {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,0,0,1,1,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0}},
{
    
    {
    
    0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,1,1,0,0,0,0},
 {
    
    0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0},
 {
    
    0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0,0},
 {
    
    0,0,0,0,1,1,1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0},
 {
    
    0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0},
 {
    
    0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0},
 {
    
    0,0,0,1,1,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0}}
};
int special_colors[2][12][30]={
    
    
{
    
    {
    
    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4},
 {
    
    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4},
 {
    
    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4},
 {
    
    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4},
 {
    
    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4},
 {
    
    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4},
 {
    
    2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6},
 {
    
    2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6},
 {
    
    2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6},
 {
    
    2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6},
 {
    
    2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6},
 {
    
    2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6}},
{
    
    {
    
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
 {
    
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1, 4, 4, 4, 4, 4, 4, 4, 4,15,15, 4, 4, 4, 4, 4},
 {
    
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1, 4, 4, 4, 4, 4, 4,15,15,15,15, 4, 4, 4, 4, 4},
 {
    
    1, 1, 1, 1, 1,15,15, 1, 1, 1, 1,1,1,1,1, 4, 4, 4, 4,15,15, 4, 4,15,15, 4, 4, 4, 4, 4},
 {
    
    1, 1, 1, 1, 1,15,15, 1, 1, 1, 1,1,1,1,1, 4, 4,15,15, 4, 4, 4, 4,15,15, 4, 4, 4, 4, 4},
 {
    
    1,15,15,15,15,15,15,15,15,15,15,1,1,1,1,15,15, 4, 4, 4, 4, 4, 4,15,15, 4, 4, 4, 4, 4},
 {
    
    2, 2, 2, 2, 2,15,15, 2, 2, 2, 2,2,2,2,2,15,15,15,15,15,15,15,15,15,15,15,15,15,15, 6},
 {
    
    2, 2, 2, 2, 2,15,15, 2, 2, 2, 2,2,2,2,2, 6, 6, 6, 6, 6, 6, 6, 6,15,15, 6, 6, 6, 6, 6},
 {
    
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2,2,2,2, 6, 6, 6, 6, 6, 6, 6, 6,15,15, 6, 6, 6, 6, 6},
 {
    
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2,2,2,2, 6, 6, 6, 6, 6, 6, 6, 6,15,15, 6, 6, 6, 6, 6},
 {
    
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2,2,2,2, 6, 6, 6, 6, 6, 6, 6, 6,15,15, 6, 6, 6, 6, 6},
 {
    
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2,2,2,2, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6}}
};
void hide()
{
    
    
	CONSOLE_CURSOR_INFO CursorInfo;
	GetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &CursorInfo);
	CursorInfo.bVisible = false;
	SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &CursorInfo);
}
void Out(int n)
{
    
    
	players[n]=true; 
	return;
}
void color(int x)
{
    
    
	if(x==0) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0x0);
	else if(x==1) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_BLUE);
	else if(x==2) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_GREEN);
	else if(x==3) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_BLUE);
	else if(x==4) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_RED);
	else if(x==5) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_BLUE | BACKGROUND_RED);
	else if(x==6) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_RED | BACKGROUND_GREEN);
	else if(x==7) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE);
	else if(x==8) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0X0 | BACKGROUND_INTENSITY);
	else if(x==9) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_BLUE | BACKGROUND_INTENSITY);
	else if(x==10) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_GREEN | BACKGROUND_INTENSITY);
	else if(x==11) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_INTENSITY);
	else if(x==12) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_RED | BACKGROUND_INTENSITY);
	else if(x==13) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_INTENSITY);
	else if(x==14) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_INTENSITY);
	else SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_INTENSITY); 
	/*
		0=黑色                8=灰色  
   	1=蓝色                9=淡蓝色             	                        
  	2=绿色                10=淡绿色            	
  	3=湖蓝色              11=淡浅绿色    
  	4=红色                12=淡红色      
  	5=紫色                13=淡紫色           
  	6=黄色                14=淡黄色          
  	7=白色                15=亮白色
	*/
}
void color3(int x)//字体颜色 z
{
    
    
	if(x>=0&&x<=15) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),x);//只有一个参数,改变字体颜色 
	else SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
	return;
}
void to_x_y(int x,int y)
{
    
    
	COORD xy_position;
	xy_position.X = x - 1;
	xy_position.Y = y - 1;
	SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),xy_position);
	return;
}
void color2(int x)
{
    
    
	if(x==1) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY | BACKGROUND_RED | FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN );
	else if(x==2) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY | BACKGROUND_RED | BACKGROUND_BLUE | FOREGROUND_INTENSITY | FOREGROUND_GREEN );
	else if(x==3) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE | 0X0);
	return;
}
void jia(int c,int d)
{
    
    
	for(int j=1;j<=d;j++){
    
    
		int x=rand()%(40+4+4+12);
		while(b[x].number==0){
    
    
			x=rand()%(40+4+4+12);
			color(15);
		}
		b[x].number--;
		a[c].push_back({
    
    b[x].all_name,b[x].color});
	}
	if(a[c].size()>most)
		Out(c);
	return;
}
int GetCh()
{
    
    
	int ch;
	while(!_kbhit()) Sleep(1);	
	ch = _getch();//使用_getch()函数获取按下的键值
	return ch;
}
void chk()
{
    
    
	for(int i=0;i<61;i++)
		if(shang.name==b[i].all_name&&shang.color==b[i].color)
		{
    
    
			b[i].number++;
			return;
		}
}
void ShowCards1(int card,int Color,int x,int y)//只适用于1至9 
{
    
    
	to_x_y(34+x,2+y);
	color3(Color);
	printf("┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓");
	for(int i=0;i<19;i++){
    
    
		to_x_y(34+x,i+3+y);
		color3(Color);
		printf("│");
		for(int j=0;j<30;j++){
    
    
			color(Cards_Shape[card][i][j]*Color);
			printf(" ");
		}
		color3(Color);
		printf("│");
	} 
	to_x_y(34+x,20+2+y); 
	printf("┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛\n");
	return;
} 
void ShowCards2(string card,int x,int y)
{
    
    
	int n=0;
	if(card=="+4") n=1;
	else n=0;
	to_x_y(34+x,2+y);
	color3(15);
	printf("┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓");
	to_x_y(34+x,3+y);
	color3(15);
	printf("│                              │");
	for(int i=0;i<12;i++){
    
    
		to_x_y(34+x,i+4+y);
		color3(15);
		printf("│");
		for(int j=0;j<30;j++){
    
    
			color(special_colors[n][i][j]);
			printf(" ");
		}
		color3(15);
		printf("│\n");
	}
	to_x_y(34+x,16+y);
	color3(15);
	printf("│                              │");
	for(int i=14;i<19;i++){
    
    
		to_x_y(34+x,i+3+y);
		color3(15);
		printf("│");
		for(int j=0;j<30;j++){
    
    
			if(Cards_Shape[0][i][j]==1)
				color(15);
			else
				color(0);
			printf(" ");
		}
		color3(15);
		printf("│\n");
	}
	color3(15);
	to_x_y(34+x,20+2+y);
	printf("┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛");
	return;
}
void ShowCards3(string name,int Color,int x,int y)
{
    
    
	int n;
	if(name=="+2") n=0;
	else if(name=="back") n=1;
	else n=2;
	to_x_y(34+x,2+y);
	color3(Color);
	printf("┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓");
	for(int i=0;i<19;i++){
    
    
		to_x_y(34+x,i+3+y);
		color3(Color);
		printf("│");
		for(int j=0;j<30;j++){
    
    
			color(Cards_Shape2[n][i][j]*Color);
			printf(" ");
		}
		color3(Color);
		printf("│\n");
	}
	to_x_y(34+x,22+y);
	color3(Color);
	printf("┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛");
	return;
}
void UpSet()
{
    
    
	for(int i=0;i<10;i++){
    
    
		for(int j=1;j<=4;j++){
    
    
			b[i*4+j].all_name=char(i+'0');
			b[i*4+j].color=colors[j];
			b[i*4+j].number=bool(i>=1)+1;
		}
	}
	for(int i=0;i<3;i++){
    
    
		for(int j=1;j<=4;j++){
    
    
			b[40+i*4+j].all_name=gnp[i];
			b[40+i*4+j].color=colors[j];
			b[40+i*4+j].number=2;
		}
	}
	for(int i=1;i<=2;i++){
    
    
		b[40+12+i].all_name=gnp[2+i];
		b[40+12+i].color=15;
		b[40+12+i].number=2;
	}
	while(true){
    
     
		for(int i=0;i<=9;i++){
    
    
			for(int j=0;j<4;j++){
    
    
				ShowCards1(i,beginColors[j],0,-1);
				int t=GetCh();
				if(t==224)
					int t2=GetCh();
				if(t==13){
    
    
					string a="";
					a+=char(i+'0');
					shang.name=a;
					shang.color=beginColors[j];
					return;
				}
			}
		} 
		for(int i=0;i<3;i++){
    
    
			for(int j=0;j<4;j++){
    
    
				ShowCards3(beginNames[i],beginColors[j],0,-1);
				int t=GetCh();
				if(t==224)
					int t2=GetCh();
				if(t==13){
    
    
					shang.name=beginNames[i];
					shang.color=beginColors[j];
					return;
				}
			}
		}
	}
	return;
}
void ShowHelp()
{
    
    
	for(int i=0;i<21;i++){
    
    
		color3(5) ;
		printf("%s\n",help[i]);
	}
	if(shang.name.size()==1) ShowCards1(shang.name[0]-'0',shang.color,-33,21);
	else if(shang.name=="+4"||shang.name=="change color") ShowCards2(shang.name,-33,21);
	else ShowCards3(shang.name,shang.color,-33,21);
	return;
}
void ShowHelp2()
{
    
    
	for(int i=0;i<21;i++){
    
    
		color3(5) ;
		printf("%s\n",help2[i]);
	} 
	return;
} 
void special_func1(int n)
{
    
    
	//+
	int N=0;
	color3(15);
	system("cls");
	printf("选手对应卡片数量:\n"); 
	for(int i=0;i<z;i++) if(i!=e-1) printf("%d:%d ",i+1,a[i].size()-1);
	while(N<=0||N>z){
    
    
		printf("\n请输入要加牌的选手编号:");
		scanf("%d",&N);
	}
	if(a[N].size()+n>11){
    
    
		Out(N); 
		return;
	}
	jia(N-1,n);
	return;
}
void special_func2(string name)
{
    
    
	int N=0;
	while(N!=1&&N!=2&&N!=4&&N!=6){
    
    
		printf("请输入要改变成的颜色编号(蓝色 1;绿色 2;红色 4;黄色 6):");
		scanf("%d",&N);
	}
	shang.name=name;
	shang.color=N;
	return;
}
void special_func3()
{
    
    
	special_func2("+4");
	color3(15);
	system("cls");
	special_func1(4);
	color3(15);
	system("cls");
	return;
}
void special_func4()
{
    
    
	ej=ej*(-1);
	return;
}
void special_func5()
{
    
    
	e+=ej;
	return;
}
void out_e()
{
    
    
	return;
}
void NoCards(int n)
{
    
    
	int j=1;
	while(true){
    
    
		to_x_y(1,22); 
		color2(j);
		printf("无牌可出!");
		for(int i=1;i<=100;i++){
    
    
			if(_kbhit()&&_getch()==13){
    
    
				jia(n,1); 
				SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | 0X0);
				system("cls");
				return;
			}
			Sleep(1);
		}
		j=j%3+1;
	}
	return;
}
int main()
{
    
    
	hide();
	srand(time(0));
	ShowHelp2();
	UpSet();
	color3(15);
	while(z<2||z>10){
    
     
		printf("请输入玩家人数:");
		scanf("%d",&z);
	} 
	while(true){
    
    
		for(int i=0;i<z;i++){
    
    
			a[i].push_back({
    
    "",0});
			jia(i,begin_n);
		}
		color3(15);
		system("pause");
		system("cls");
		while(true){
    
    
			e+=ej;
			if(e>z) e=e-z;
			else if(e<1) e=z-(0-e);
			while(players[e]){
    
    
				e+=ej;
				if(e>z) e=e-z;
				else if(e<1) e=z-(0-e);
			}
			color3(15);
			system("cls");
			printf("请选手%d出牌\n",e);
			system("pause");
			system("cls");
			ShowHelp();
			int n=1,t=1;
			bool FLAG=true;
			for(int i=1;i<a[e-1].size();i++)
				if(a[e-1][i].name==shang.name||a[e-1][i].color==shang.color||a[e-1][i].name=="+4"||a[e-1][i].name=="change color"){
    
    
					FLAG=false;
					break;
				}
			while(true){
    
    
				for(int i=a[e-1].size()-1;i>n;i--){
    
    
					color3(a[e-1][i].color);
					to_x_y(36+30+i+a[e-1].size()-n,1+a[e-1].size()+n-i);
					printf("┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓");
					for(int j=2;j<=20;j++){
    
    
						to_x_y(97+i+a[e-1].size()-n,j+a[e-1].size()+n-i);
						color3(a[e-1][i].color);
						printf("│");
					}
					color3(a[e-1][i].color);
					to_x_y(97+i+a[e-1].size()-n,21+a[e-1].size()+n-i);
					printf("┛");
					if(i==n+1){
    
    
						to_x_y(80+i+a[e-1].size()-n,21+a[e-1].size()+n-i);
						printf("━━━━━━━━━━━━━━━━━");
					}
				}
				for(int i=0;i<=n-1;i++){
    
    
					color3(a[e-1][i].color);
					to_x_y(36+i+a[e-1].size()-n,1+i+a[e-1].size()-n);
					printf("┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓");
					for(int j=2;j<=20;j++){
    
    
						to_x_y(36+i+a[e-1].size()-n,i+j+a[e-1].size()-n);
						color3(a[e-1][i].color);
						printf("│");
					}
					color3(a[e-1][i].color);
					to_x_y(36+i+a[e-1].size()-n,i+21+a[e-1].size()-n);
					printf("┗");
					if(i==n-1){
    
    
						to_x_y(36+i+1+a[e-1].size()-n,i+21+a[e-1].size()-n);
						printf("━━━━━━━━━━━━");
					}
				}
				if(a[e-1][n].name.size()==1) ShowCards1(a[e-1][n].name[0]-'0',a[e-1][n].color,15+a[e-1].size()-1,a[e-1].size()-1);
				else if(a[e-1][n].name=="+4"||a[e-1][n].name=="change color") ShowCards2(a[e-1][n].name,15+a[e-1].size()-1,a[e-1].size()-1);
				else ShowCards3(a[e-1][n].name,a[e-1][n].color,15+a[e-1].size()-1,a[e-1].size()-1);
				hide();
				if(FLAG){
    
    
					NoCards(e-1);
					break; 
				}	
				t=GetCh();
				switch(t){
    
    
					case 224:{
    
    
						int t2=GetCh();
						if(t2==77&&n<a[e-1].size()-1){
    
    
							to_x_y(36+30+a[e-1].size()+a[e-1].size()-n-1,n+2);
							printf("                                ");
							for(int j=2;j<=21;j++){
    
    
								to_x_y(97+a[e-1].size()+a[e-1].size()-n-1,j+n+1);
								printf(" ");
							}
							n++;
							if(n==a[e-1].size()-1){
    
    
								to_x_y(97-17+a[e-1].size()+a[e-1].size()-n,n+21);
								printf("                  ");
								
							}
						}
						else if(t2==75&&n>1) n--;
						break;
					}
					case 13:{
    
    
						if(shang.color==a[e-1][n].color||shang.name==a[e-1][n].name){
    
    
							shang.color=a[e-1][n].color;
							shang.name=a[e-1][n].name;
							a[e-1].erase(a[e-1].begin()+n);
							color3(15);
							system("cls");
							if(shang.name=="+2")
								special_func1(2);
							else if(shang.name=="stop")
								special_func5();
							else if(shang.name=="back")
								special_func4();
							f=1;
							chk();
							break;
						}
						else if(a[e-1][n].name=="+4"){
    
    
							a[e-1].erase(a[e-1].begin()+n);
							color3(15);
							system("cls");
							special_func3();
							f=1;
							chk();
							break;
						}
						else if(a[e-1][n].name=="change color"){
    
    
							a[e-1].erase(a[e-1].begin()+n);
							color3(15);
							system("cls");
							special_func2("change color");
							f=1;
							chk();
							break;
						}
					}
				}
				if(f==1){
    
    
					f=0;
					break;
				}
			}
			for(int i=0;i<z;i++)
				if(a[i].size()<2){
    
    
					color3(15);
					system("cls");
					cout<<"选手"<<i+1<<"胜"; 
					return 0;
				} 
		}
	}
}

猜你喜欢

转载自blog.csdn.net/weixin_41247488/article/details/119849631
今日推荐