func checkAndRemoveFullLanes(board [][]BoardElement) int {
	fullRows := make([]bool, len(board))
	fullCols := make([]bool, len(board))
	for i := 0; i < len(board); i++ {
		fullRows[i] = true
		fullCols[i] = true
	}

	score := 0

	// check all full rows and columns before removing anything
	for x := 0; x < len(board); x++ {
		for y := 0; y < len(board); y++ {
			if fullRows[x] {
				fullRows[x] = board[x][y] != None
			}
			if fullCols[y] {
				fullCols[y] = board[x][y] != None
			}
		}
	}

	// remove rows
	for x := 0; x < len(fullRows); x++ {
		if !fullRows[x] {
			continue
		}

		score += len(fullCols)

		for y := 0; y < len(fullCols); y++ {
			board[x][y] = None
		}
	}

	// remove columns
	for y := 0; y < len(fullCols); y++ {
		if !fullCols[y] {
			continue
		}

		score += len(fullRows)

		for x := 0; x < len(fullRows); x++ {
			board[x][y] = None
		}
	}

	return score
}
// checkAndRemoveFullLanes firstly counts all full rows and columns
// and then removes them from the board, replacing with None value
checkAndRemoveFullLanes firstly counts all full rows and columns
and then removes them from the board, replacing with None value
// checkAndRemoveFullLanes firstly counts all full rows and columns // and then removes them from the board replacing with None value
func checkAndRemoveFullLanes(board [][]BoardElement) int {
	fullRows := make([]bool, len(board))
	fullCols := make([]bool, len(board))
	for i := 0; i < len(board); i++ {
		fullRows[i] = true
		fullCols[i] = true
	}
	score := 0
	for x := 0; x < len(board); x++ {
		for y := 0; y < len(board); y++ {
			if fullRows[x] {
				fullRows[x] = board[x][y] != None
			}
			if fullCols[y] {
				fullCols[y] = board[x][y] != None
			}
		}
	}
	for x := 0; x < len(fullRows); x++ {
		if !fullRows[x] {
			continue
		}
		score += len(fullCols)
		for y := 0; y < len(fullCols); y++ {
			board[x][y] = None
		}
	}
	for y := 0; y < len(fullCols); y++ {
		if !fullCols[y] {
			continue
		}
		score += len(fullRows)
		for x := 0; x < len(fullRows); x++ {
			board[x][y] = None
		}
	}
	return score
}
func checkAndRemoveFullLanes ( board [ ] [ ] BoardElement ) int { fullRows := make ( [ ] bool , len ( board ) ) fullCols := make ( [ ] bool , len ( board ) ) for i := 0 ; i < len ( board ) ; i ++ { fullRows [ i ] = true fullCols [ i ] = true } score := 0 for x := 0 ; x < len ( board ) ; x ++ { for y := 0 ; y < len ( board ) ; y ++ { if fullRows [ x ] { fullRows [ x ] = board [ x ] [ y ] != None } if fullCols [ y ] { fullCols [ y ] = board [ x ] [ y ] != None } } } for x := 0 ; x < len ( fullRows ) ; x ++ { if ! fullRows [ x ] { continue } score += len ( fullCols ) for y := 0 ; y < len ( fullCols ) ; y ++ { board [ x ] [ y ] = None } } for y := 0 ; y < len ( fullCols ) ; y ++ { if ! fullCols [ y ] { continue } score += len ( fullRows ) for x := 0 ; x < len ( fullRows ) ; x ++ { board [ x ] [ y ] = None } } return score }
checkAndRemoveFullLanes firstly counts all full rows and columns
and then removes them from the board, replacing with None value
checkAndRemoveFullLanes firstly counts all full rows and columns and then removes them from the board replacing with None value
// check all full rows and columns before removing anything // remove rows // remove columns