30 lines
539 B
Swift
30 lines
539 B
Swift
import Engine
|
|
|
|
let board = Board(
|
|
fen: .init(
|
|
fen: "rnbqkb1r/pppppppp/2n5/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"))
|
|
// let board: Board = .init()
|
|
print(board)
|
|
|
|
// Execute every time the timer changes
|
|
// board.on(.timer) { time in
|
|
|
|
// }
|
|
|
|
do {
|
|
try board.move(src: "e4", dst: "f6")
|
|
} catch {
|
|
print(error)
|
|
}
|
|
do {
|
|
try board.move(src: .init(rank: 2, file: 5), dst: .init(rank: 4, file: 5))
|
|
} catch {
|
|
print(error)
|
|
}
|
|
|
|
print(board)
|
|
print(board.fen)
|
|
print(board.history.values)
|
|
|
|
// let square = board.getSquareInfo(on: .init(rank: 2, file: 7))
|