# 二七十，大贰，跑胡子的吃牌算法

int qumoPai = -1;
//这里取模判断区间
if(targetPai>9){

qumoPai=targetPai%9-1;
}else{
qumoPai=targetPai%9;
}

//这里的map是自己手上的牌
//是否需要跟牌
boolean isgen = false;
ArrayList<String> chipais = new ArrayList<>();
Integer integer = map.get(targetPai);
if (integer==1){
isgen = true;
}
//能放在左边的就是1-8
if (qumoPai>=0&&qumoPai<8){
Integer right1 = map.get(targetPai+1);
Integer right2 = map.get(targetPai+2);
if (right1!=null&&right2!=null&&right1<3&&right2<3){
if (right1>0&&right2>0){
String chipai =targetPai+1+","+(targetPai+2);
}
}
}
//能放在中间的就是2-9
if (qumoPai>=1&&qumoPai<9){
Integer left1 = map.get(targetPai-1);
Integer right1 = map.get(targetPai+1);
if (left1!=null&&right1!=null&&left1<3&&right1<3){
if (left1>0&&right1>0){
String chipai =(targetPai-1)+","+(targetPai+1);

//System.out.println((targetPai-1)+","+targetPai+","+(targetPai+1));
}
}
}
//能放在最右边的就是3-10
if (qumoPai>=2&&qumoPai<10){
Integer left1 = map.get(targetPai-1);
Integer left2 = map.get(targetPai-2);
if (left1!=null&&left2!=null){
if (left1>0&&left2>0){
String chipai =(targetPai-2)+","+(targetPai-1);
//   System.out.println((targetPai-2)+","+(targetPai-1)+","+targetPai);
}
}
}

public String chi_erqishi(int targetPai,Map<Integer,Integer>  maps){

if (targetPai==1){
Integer qi = maps.get(6);
Integer shi = maps.get(9);
boolean isnullqidayuling = isnullqidayuling(qi, shi);
if (!isnullqidayuling){
return "6,9";
}
}
if (targetPai==6){
Integer er = maps.get(1);
Integer shi = maps.get(9);
boolean isnullqidayuling = isnullqidayuling(er, shi);
if (!isnullqidayuling){
return "1,9";
}
}
if (targetPai==9){
Integer er = maps.get(1);
Integer qi = maps.get(6);
boolean isnullqidayuling = isnullqidayuling(er, qi);
if (!isnullqidayuling){
return "1,6";
}
}
if (targetPai==11){
Integer taiqi = maps.get(16);
Integer taishi = maps.get(19);
boolean isnullqidayuling = isnullqidayuling(taiqi, taishi);
if (!isnullqidayuling){
return "16,19";
}
}
if (targetPai==16){
Integer taiqi = maps.get(11);
Integer taishi = maps.get(19);
boolean isnullqidayuling = isnullqidayuling(taiqi, taishi);
if (!isnullqidayuling){
return "11,19";
}
}
if (targetPai==19){
Integer taiqi = maps.get(16);
Integer taishi = maps.get(11);
boolean isnullqidayuling = isnullqidayuling(taiqi, taishi);
if (!isnullqidayuling){
return "11,16";
}
}

return null;
}

public String chi_yidaliangxiao(int targetPai,Map<Integer,Integer>  maps){
if (targetPai>10){
Integer xiaopai = maps.get(targetPai-10);
boolean isnullqidayuling = isnullqidayuling(xiaopai);
if (!isnullqidayuling&&xiaopai==2){
return (targetPai-10)+","+(targetPai-10);
}
}
if (targetPai<10){
Integer xiaopai = maps.get(targetPai);
Integer dapai = maps.get(targetPai+10);
boolean isnullqidayuling = isnullqidayuling(xiaopai , dapai);
if (!isnullqidayuling&&dapai<3&&xiaopai==1){
return targetPai+","+(targetPai+10);
}
}
return null;
}

/*两大一小*/
public String chi_lingdayixiao(int targetPai,Map<Integer,Integer>  maps){
if (targetPai<10){
Integer pai = maps.get(10+targetPai);
boolean isnullqidayuling = isnullqidayuling(pai);
if (!isnullqidayuling&&pai==2){
return (targetPai+10)+","+(targetPai+10);
}
}
if (targetPai>10){
Integer xiaopai = maps.get(targetPai-10);
Integer dapai = maps.get(targetPai);
boolean isnullqidayuling = isnullqidayuling(xiaopai , dapai);
if (!isnullqidayuling&&xiaopai<2&&dapai==1){
return targetPai+","+(targetPai-10);
}
}
return null;
}

11-08

09-03
12-16 2595
01-05 1万+
10-23 3080
10-12 1万+
05-01 7896
07-15 6943
12-14
06-28
08-14 864
07-06 1万+
04-09 6493
09-28
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客