Skip to content

Commit 9055d87

Browse files
authored
Merge branch 'dev' into pla-1039-add-hyper-backgammon-variant
2 parents c9c6ed8 + 20c141e commit 9055d87

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Update Dependency Graph
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- dev #default branch of project
8+
9+
jobs:
10+
update-graph:
11+
name: Update Dependency Graph
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: scalacenter/sbt-dependency-submission@v3
16+
with:
17+
working-directory: './'

src/main/scala/Clock.scala

+3-2
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ case class ByoyomiClock(
669669
else {
670670
val player = players(c)
671671
val timeUsed = timestampFor(c).fold(Centis(0))(t =>
672-
if (withGrace) (toNow(t) - (players(c).lag.quota atMost Centis(200))) nonNeg
672+
if (withGrace) (toNow(t) - (player.lag.quota atMost Centis(200))) nonNeg
673673
else toNow(t)
674674
)
675675
val timeRemaining = player.remaining + player.periodsLeft * player.byoyomi
@@ -770,7 +770,8 @@ case class ByoyomiClock(
770770
if (usingByoyomi)
771771
updatePlayer(player) {
772772
_.setRemaining(
773-
(remaining - moveTime) atLeast (if (switchClock) competitor.byoyomi
773+
(remaining - moveTime) atLeast (if (!clockActive) Centis(0)
774+
else if (switchClock) competitor.byoyomi
774775
else timeRemainingAfterMove)
775776
)
776777
.spendPeriods(periodSpan)

src/main/scala/samurai/Api.scala

+3-5
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ package strategygames.samurai
33
import com.joansala.game.oware.OwareGame
44
import com.joansala.game.oware.OwareBoard
55

6-
import cats.implicits._
7-
86
import strategygames.Player
97
import strategygames.samurai.format.FEN
108
import strategygames.samurai.variant.Variant
@@ -177,9 +175,9 @@ object Api {
177175
lazy val gameOutcome: Int = position.outcome()
178176
lazy val isRepetition: Boolean = position.isRepetition() && !allSeedsOnSameSide
179177

180-
lazy val allSeedsOnSameSide: Boolean = toPosition
181-
.take(variant.boardSize.width)
182-
.sum === 0 || toPosition.drop(variant.boardSize.width).take(variant.boardSize.width).sum === 0;
178+
lazy val allSeedsOnSameSide: Boolean =
179+
toPosition.take(variant.boardSize.width).sum == 0 ||
180+
toPosition.drop(variant.boardSize.width).take(variant.boardSize.width).sum == 0
183181

184182
val legalMoves: Array[Int] = {
185183
position.resetCursor()

0 commit comments

Comments
 (0)