Improve cpu player.
This commit is contained in:
parent
09a89880e6
commit
6231238d27
@ -945,8 +945,10 @@ const INTERFACE = {
|
||||
}
|
||||
|
||||
if(GAME_DATA.config.rules.par != 0) {
|
||||
if(GAME_DATA.turn >= (GAME_DATA.config.rules.par * 2)) {
|
||||
message = "Par " + GAME_DATA.config.rules.par;
|
||||
}
|
||||
}
|
||||
|
||||
switch(GAME_DATA.state.code) {
|
||||
case GAME.Const.State.Resign: {
|
||||
@ -1976,6 +1978,7 @@ const INTERFACE = {
|
||||
if(move.valid) {
|
||||
moves.push({
|
||||
score: 0,
|
||||
true_score: 0,
|
||||
play: new GAME.Play(1, p, move.tile),
|
||||
});
|
||||
}
|
||||
@ -2009,12 +2012,13 @@ const INTERFACE = {
|
||||
st.process(moves[mv].play);
|
||||
|
||||
moves[mv].score = state_score(st, player);
|
||||
if(depth == 0) {
|
||||
moves[mv].score = state_score(st, search_player);
|
||||
} else {
|
||||
moves[mv].true_score = state_score(st, search_player);
|
||||
|
||||
if(depth > 0) {
|
||||
let result = determine_play(st, search_player, depth - 1);
|
||||
if(result !== null) {
|
||||
moves[mv].score = result.score;
|
||||
moves[mv].score = result.true_score;
|
||||
moves[mv].true_score = result.true_score;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user