Skip to content

Commit 64c8c9a

Browse files
committed
Wunchunk: Smarter click handling during open setup
1 parent 6e4fa69 commit 64c8c9a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/games/wunchunk.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,14 @@ export class WunchunkGame extends GameBase {
298298
if (lastmove.length > 0) {
299299
lastmove += cell;
300300
} else {
301-
lastmove = `${this.swapped ? (this.currplayer === 1 ? 2 : 1) : this.currplayer}${cell}`;
301+
// during setup, assume four bare clicks are red, red, blue, blue
302+
if (this.variants.includes("open") && this.stack.length === 1) {
303+
lastmove = `${steps.length < 2 ? 1 : 2}${cell}`;
304+
}
305+
// otherwise bare clicks assume current player
306+
else {
307+
lastmove = `${this.swapped ? (this.currplayer === 1 ? 2 : 1) : this.currplayer}${cell}`;
308+
}
302309
}
303310
newmove = [...steps, lastmove].join(",");
304311
}

0 commit comments

Comments
 (0)