Skip to content

Commit

Permalink
Merge pull request #1043 from Mind-Sports-Games/dev
Browse files Browse the repository at this point in the history
dev to master (backgammon fixes)
  • Loading branch information
JamesHeppell authored Feb 6, 2025
2 parents dbbf18d + 329746e commit e490b0f
Show file tree
Hide file tree
Showing 20 changed files with 338 additions and 276 deletions.
11 changes: 5 additions & 6 deletions modules/game/src/main/Game.scala
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ case class Game(

def opponent(c: PlayerIndex): Player = player(!c)

lazy val naturalOrientation = variant match {
case Variant.Chess(strategygames.chess.variant.RacingKings) => P1
case _ => PlayerIndex.fromP1(p1Player before p2Player)
}
lazy val naturalOrientation = P1

def turnPlayerIndex = stratGame.player

Expand Down Expand Up @@ -383,9 +380,11 @@ case class Game(
val score = (if (playerIndex.name == "p1") fen.player1Score else fen.player2Score) / 10.0
score.toString().replace(".0", "")
case "backgammon" | "hyper" | "nackgammon" => {
multiPointState.fold(history.score(playerIndex)){mps => playerIndex.fold(mps.p1Points, mps.p2Points)}.toString()
multiPointState
.fold(history.score(playerIndex)) { mps => playerIndex.fold(mps.p1Points, mps.p2Points) }
.toString()
}
case _ => ""
case _ => ""
}

def displayScore: Option[Score] =
Expand Down
4 changes: 0 additions & 4 deletions modules/quote/src/main/Quote.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1301,10 +1301,6 @@ object Quote {
),
new Quote("Chess is beautiful enough to waste your life for.", "Hans Ree"),
new Quote("Chess is eminently and emphatically the philosopher's game.", "Paul Morphy"),
new Quote(
"Chess is far too complex to be definitively solved with any technology we can conceive of today. However, our looked-down-upon cousin, checkers, or draughts, suffered this fate quite recently thanks to the work of Jonathan Schaeffer at the University of Alberta and his unbeatable program Chinook.",
"Garry Kasparov"
),
new Quote(
"Chess is infinite, and one has to make only one ill-considered move, and one`s opponent`s wildest dreams will become reality.",
"David Bronstein"
Expand Down
4 changes: 2 additions & 2 deletions modules/swiss/src/main/SwissForm.scala
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ final class SwissForm(implicit mode: Mode) {

object SwissForm {

val clockLimits: Seq[Int] = Seq(0, 15, 30, 45, 60, 90) ++ {
(120 to 420 by 60) ++ (600 to 1800 by 300) ++ (2400 to 10800 by 600)
val clockLimits: Seq[Int] = Seq(0, 15, 30, 45, 60, 90, 120, 150) ++ {
(180 to 720 by 60) ++ (900 to 1800 by 300) ++ (2400 to 10800 by 600)
}
val clockLimitChoices = clockTimeChoicesFromSeconds(clockLimits)

Expand Down
2 changes: 1 addition & 1 deletion modules/swiss/src/main/SwissJson.scala
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ object SwissJson {
)
}
)
.add("multiPointScore" -> multiPointScoreJson(g))

private[swiss] def boardPlayerFromGame(g: Game, b: SwissBoard, playerIndex: PlayerIndex) =
if (playerIndex == P1)
Expand Down Expand Up @@ -416,7 +417,6 @@ object SwissJson {
l.map(g =>
boardGameJson(g, boardPlayerFromGame(g, b.board, P1), boardPlayerFromGame(g, b.board, P2))
.add("boardSize" -> boardSizeJson(g.variant))
.add("multiPointScore" -> multiPointScoreJson(g))
)
)
)
Expand Down
50 changes: 28 additions & 22 deletions public/images/board/backgammon/svg/blue_d_cube_five.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 23 additions & 17 deletions public/images/board/backgammon/svg/blue_d_cube_four.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 18 additions & 14 deletions public/images/board/backgammon/svg/blue_d_cube_one.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 25 additions & 20 deletions public/images/board/backgammon/svg/blue_d_cube_six.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 22 additions & 17 deletions public/images/board/backgammon/svg/blue_d_cube_three.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e490b0f

Please sign in to comment.