We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b89943 commit 45488a2Copy full SHA for 45488a2
src/games/arimaa.ts
@@ -499,6 +499,11 @@ export class ArimaaGame extends GameBase {
499
newmove = stub;
500
}
501
} else {
502
+ // if just clicking directly on the board, select the strongest piece in hand
503
+ if (lastmove === undefined || lastmove === "") {
504
+ const sorted = [...cloned.hands![cloned.currplayer - 1]].sort((a,b) => ArimaaGame.strength(b) - ArimaaGame.strength(a));
505
+ lastmove = cloned.currplayer === 1 ? sorted[0] : sorted[0].toLowerCase();
506
+ }
507
newmove = `${stub}${stub.length > 0 ? "," : ""}${lastmove}${cell}`;
508
509
0 commit comments