class AI{ constructor(param) { param = param || {}; } classify(pokerList){ pokerList.sort(this.sortFunction); let lastPoker = pokerList[0]; let curList = [lastPoker]; let lists = []; for(let i=1; i0){ let curList = [Count3List[0]]; let lists = []; for(let i2=1; i21){ threeList.push(lists[i3]); }else{ three.push(lists[i3][0]); } } } if(Count2List.length>0){ let curList2 = [Count2List[0]]; let lists2 = []; for(let i4=1; i42){ twoList.push(lists2[i5]); }else{ two = two.concat(lists2[i5]); } } } if(Count1List.length>0){ let curList1 = [Count1List[0]]; let lists1 = []; for(let i6=1; i64){ oneList.push(lists1[i7]); }else{ one = one.concat(lists1[i7]); } } } //combine one two together if(one.length>0&&two.length>0){ let oneIndex = 0; let twoIndex = 0; while(true){ if(oneIndex>one.length-1&&twoIndex>two.length-1){ break; } let startN; let lastN; let ones = []; let twos = []; if(one.length===0 || oneIndex>one.length-1){ break; } if(two.length===0 || twoIndex>two.length-1){ startN = one[oneIndex][0].number; ones.push(one[oneIndex]); oneIndex++; }else{ if(one[oneIndex][0].numberone.length-1&&twoIndex>two.length-1){ break; } if(oneIndex