func (board *Board) getFileRankByXY(square Square) (chessapi.Coord, bool) {
	for coord, xy := range board.SquareOriginByCoords {
		if xy[0] == square.OriginX && xy[1] == square.OriginY {
			return coord, true
		}
	}
	return chessapi.Coord{}, false
}
getFileRankByXY a coordinate for a set of rank (y) and file (x) coordinates
package chess
import (
	"image/color"
	"github.com/faiface/pixel"
	"github.com/faiface/pixel/imdraw"
	"github.com/faiface/pixel/pixelgl"
	chessapi "github.com/miketmoore/chess-api"
)
const totalSquares = 64
const totalRows = 8
const totalCols = 8
type BoardMap map[chessapi.Coord]Square
type Square struct {
	Shape   *imdraw.IMDraw
	OriginX float64
	OriginY float64
}
type Board struct {
	Squares              BoardMap
	SquareOriginByCoords map[chessapi.Coord][]float64
}
func (board *Board) GetCoord(vec pixel.Vec) (chessapi.Coord, bool) {
	for _, square := range board.Squares {
		if vec.X > square.OriginX &&
			vec.X < (square.OriginX+50) &&
			vec.Y > square.OriginY &&
			vec.Y < (square.OriginY+50) {
			coord, ok := board.getFileRankByXY(square)
			if ok {
				return coord, true
			}
		}
	}
	return chessapi.Coord{}, false
}