Skip to content

Commit

Permalink
Fix knight moves being generated wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
zbyju committed Oct 13, 2024
1 parent 353659a commit bcf8947
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/scala/model/board/Coords.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ case class Coords private (rank: Byte, file: Byte) {
require(dir >= 0 && dir <= 7)
val ys = Seq(2, 1, -1, -2, -2, -1, 1, 2)
val xs = Seq(1, 2, 2, 1, -1, -2, -2, -1)
Coords((rank + ys(dir)).toByte, (rank + xs(dir)).toByte)
Coords((rank + ys(dir)).toByte, (file + xs(dir)).toByte)
}

override def toString(): String = {
Expand Down

0 comments on commit bcf8947

Please sign in to comment.