1
0
mirror of https://github.com/maaslalani/gambit.git synced 2025-01-16 02:33:26 +02:00
gambit/board/board.go
Maas Lalani 8004a4bf4f
fen
2021-12-22 01:30:33 -05:00

23 lines
458 B
Go

package board
import (
"github.com/maaslalani/gambit/piece"
)
type Board struct {
// The board is represented as a 2D array of cells.
// The first index is the row, the second is the column.
Grid [8][8]piece.Piece
reversed bool
Turn piece.Color
}
func New() Board {
ep := piece.Empty()
er := [8]piece.Piece{ep, ep, ep, ep, ep, ep, ep, ep}
return Board{
Grid: [8][8]piece.Piece{er, er, er, er, er, er, er, er},
Turn: piece.White,
}
}