Skip to content

Commit

Permalink
Code golf Antichess
Browse files Browse the repository at this point in the history
  • Loading branch information
lenguyenthanh committed Mar 20, 2024
1 parent c1ac9ca commit 334559e
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/main/scala/variant/Antichess.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,7 @@ case object Antichess

// We consider the case where a player has two knights
if whiteKnights.size != 1 || blackKnights.size != 1 then false
else
{
for
whiteKnight <- whiteKnights.headOption
blackKnight <- blackKnights.headOption
yield whiteKnight.isLight == blackKnight.isLight
}.getOrElse(false)
else whiteKnights.forall(_.isLight) == blackKnights.forall(_.isLight)
}

// No player can win if the only remaining pieces are opposing bishops on different coloured
Expand Down

0 comments on commit 334559e

Please sign in to comment.