add coward
This commit is contained in:
parent
5bb2040a5b
commit
4479dfdec5
2 changed files with 36 additions and 21 deletions
12
main.js
12
main.js
|
@ -462,8 +462,8 @@ const generous = board => {
|
|||
};
|
||||
return min_move_by(board, generous_score);
|
||||
};
|
||||
const no_i_insist = board => {
|
||||
let no_i_insist_score = (b) => {
|
||||
const coward = board => min_move_by(board, sum_of_possible_capture_value);
|
||||
function no_i_insist_score(b) {
|
||||
if (b.isCheckmate()) {
|
||||
return 612;
|
||||
}
|
||||
|
@ -472,7 +472,8 @@ const no_i_insist = board => {
|
|||
}
|
||||
let prev_value = value_of_pieces_of_color(b, ROBOT_COLOR);
|
||||
return -(sum_of_possible_capture_value(b) / b.moves().length);
|
||||
};
|
||||
}
|
||||
const no_i_insist = board => {
|
||||
return min_move_by(board, no_i_insist_score);
|
||||
};
|
||||
const pacifist = board => {
|
||||
|
@ -543,6 +544,11 @@ const players = [
|
|||
name: "no_i_insist",
|
||||
description: "Maximizes the proportion of potential capture value of YOUR moves to the number of YOUR moves; very weird the way i've done it",
|
||||
},
|
||||
{
|
||||
f: coward,
|
||||
name: "coward",
|
||||
description: "Surprisingly uncowardly, tries to avoid losing pieces, weighted by value",
|
||||
},
|
||||
{
|
||||
f: reverse_starting,
|
||||
name: "reverse_starting",
|
||||
|
|
15
main.ts
15
main.ts
|
@ -549,8 +549,10 @@ const generous: Player = board => {
|
|||
return min_move_by(board, generous_score);
|
||||
};
|
||||
|
||||
const no_i_insist: Player = board => {
|
||||
let no_i_insist_score = (b: Chess) => {
|
||||
const coward: Player = board =>
|
||||
min_move_by(board, sum_of_possible_capture_value);
|
||||
|
||||
function no_i_insist_score(b: Chess) {
|
||||
if (b.isCheckmate()) {
|
||||
return 612;
|
||||
}
|
||||
|
@ -559,8 +561,9 @@ const no_i_insist: Player = board => {
|
|||
}
|
||||
let prev_value = value_of_pieces_of_color(b, ROBOT_COLOR);
|
||||
return -(sum_of_possible_capture_value(b) / b.moves().length);
|
||||
};
|
||||
}
|
||||
|
||||
const no_i_insist: Player = board => {
|
||||
return min_move_by(board, no_i_insist_score);
|
||||
};
|
||||
|
||||
|
@ -644,6 +647,12 @@ const players = [
|
|||
description:
|
||||
"Maximizes the proportion of potential capture value of YOUR moves to the number of YOUR moves; very weird the way i've done it",
|
||||
},
|
||||
{
|
||||
f: coward,
|
||||
name: "coward",
|
||||
description:
|
||||
"Surprisingly uncowardly, tries to avoid losing pieces, weighted by value",
|
||||
},
|
||||
{
|
||||
f: reverse_starting,
|
||||
name: "reverse_starting",
|
||||
|
|
Loading…
Reference in a new issue