提交 570e189e 编写于 作者: C changjiuxiong

AI 组牌

上级 ff798c3f
......@@ -154,8 +154,6 @@ class AI{
let oneIndex = 0;
let twoIndex = 0;
let findlist = false;
while(true){
if(oneIndex>one.length-1&&twoIndex>two.length-1){
......@@ -241,7 +239,6 @@ class AI{
oneList.push(cmbList);
one.sort(this.sortArray);
findlist = true;
oneIndex = 0;
twoIndex = 0;
break;
......@@ -255,6 +252,26 @@ class AI{
}
//combine one oneList together
for(let i10=0; i10<one.length; i10++){
let find1 = false;
for(let i11=0; i11<oneList.length; i11++){
if(one[i10][0].number===oneList[i11][0][0].number-1){
oneList[i11].unshift(one[i10]);
find1 = true;
break;
}else if(one[i10][0].number===oneList[i11][oneList[i11].length-1][0].number+1){
oneList[i11].push(one[i10]);
find1 = true;
break;
}
}
if(find1){
one.splice(i10,1);
i10--;
}
}
return {
four,
three,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册