Test + bug fixes

This commit is contained in:
cdricms
2024-06-26 01:07:03 +02:00
parent 0ea0ec1bc6
commit 78a4737015
5 changed files with 100 additions and 104 deletions

View File

@@ -5,11 +5,12 @@ public struct Square: Equatable {
public let rank: UInt8
public var index: Int {
return Int(file * rank) - 1
let r = (8 - rank) % 8
return Int(8*r+file-1)
}
public static func == (lhs: Position, rhs: Position) -> Bool {
return lhs.rank == rhs.rank && lhs.file == rhs.file
return lhs.index == rhs.index
}
}