func (b Board) MarshalJSON() ([]byte, error) {
	unusedTiles := b.sortedUnusedTiles()
	usedTiles := b.sortedUsedTiles()
	jb := jsonBoard{
		Tiles:         unusedTiles,
		TilePositions: usedTiles,
	}
	if b.Config.NumRows != 0 || b.Config.NumCols != 0 { // do not marshal zero value
		jb.Config = &b.Config
	}
	return json.Marshal(jb)
}
// MarshalJSON implements the encoding/json.Marshaler interface.
// Returns an object containing the array of unused tiles, map of tile positions, and the board config.
MarshalJSON implements the encoding/json.Marshaler interface.
Returns an object containing the array of unused tiles, map of tile positions, and the board config.
// MarshalJSON implements the encoding / json . Marshaler interface . // Returns an object containing the array of unused tiles map of tile positions and the board config .
func (b Board) MarshalJSON() ([]byte, error) {
	unusedTiles := b.sortedUnusedTiles()
	usedTiles := b.sortedUsedTiles()
	jb := jsonBoard{
		Tiles:         unusedTiles,
		TilePositions: usedTiles,
	}
	if b.Config.NumRows != 0 || b.Config.NumCols != 0 { 
		jb.Config = &b.Config
	}
	return json.Marshal(jb)
}
func ( b Board ) MarshalJSON ( ) ( [ ] byte , error ) { unusedTiles := b . sortedUnusedTiles ( ) usedTiles := b . sortedUsedTiles ( ) jb := jsonBoard { Tiles : unusedTiles , TilePositions : usedTiles , } if b . Config . NumRows != 0 || b . Config . NumCols != 0 { jb . Config = & b . Config } return json . Marshal ( jb ) }
MarshalJSON implements the encoding/json.Marshaler interface.
MarshalJSON implements the encoding / json . Marshaler interface .
// do not marshal zero value