Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SOFT Core
SOFT 260
Boost Board Game
Commits
1ffbe5ab
Commit
1ffbe5ab
authored
Oct 01, 2021
by
Brady James Garvin
Browse files
Fixed spelling error propagated by autocomplete.
parent
c4f228ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
boost-engine/src/engine/engine.js
View file @
1ffbe5ab
...
...
@@ -145,19 +145,19 @@ export default class PruningEngine extends Engine {
}
_tiebreakByInfall
(
moves
)
{
let
bestIndic
i
es
=
[];
let
bestIndices
=
[];
let
bestInfall
=
-
Infinity
;
for
(
let
index
=
moves
.
length
;
index
--
;)
{
const
infall
=
this
.
_getInfall
(
moves
[
index
]);
if
(
infall
>
bestInfall
)
{
bestIndic
i
es
=
[];
bestIndices
=
[];
bestInfall
=
infall
;
}
if
(
infall
>=
bestInfall
)
{
bestIndic
i
es
.
push
(
index
);
bestIndices
.
push
(
index
);
}
}
const
index
=
bestIndic
i
es
[
Math
.
floor
(
Math
.
random
()
*
bestIndic
i
es
.
length
)];
const
index
=
bestIndices
[
Math
.
floor
(
Math
.
random
()
*
bestIndices
.
length
)];
const
bestMove
=
moves
[
index
];
moves
[
index
]
=
moves
[
0
];
moves
[
0
]
=
bestMove
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment