提交 d8c149e9 编写于 作者: C changjiuxiong

叫分 AI优化

上级 1f6cb762
......@@ -306,6 +306,25 @@ class AI{
};
}
getJiaoFen(){
this.player.getClassifyObj();
let classifyObj = this.player.classifyObj;
let num15 = classifyObj.poker15.length;
let num16 = classifyObj.poker16.length;
let num17 = classifyObj.poker17.length;
let score = num15*2 + num16*3 +num17*4;
if(score<8){
return 0;
}else if(score<10){
return 1;
}else if(score<12){
return 2;
}else{
return 3;
}
}
//接牌1 最小接 不拆 炸
getByObj1(lastObj){
let obj;
......
......@@ -38,7 +38,8 @@ class Player{
}
}
if(that.game.stage==='jiaoFen' && that.game.currentJiaoFenPlayer === that){
that.setJiaoFen(3);
let fen = that.ai.getJiaoFen();
that.setJiaoFen(fen);
}
setTimeout(function(){
......@@ -63,7 +64,7 @@ class Player{
//组牌
getClassifyObj(){
this.classifyObj = this.ai.getClassifyObj(this.pokerList);
console.log(this.classifyObj);
// console.log(this.classifyObj);
}
addPoker(poker){
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册