Test + bug fixes
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user