What you want to do is not possible with slice syntax. You think that it x[i][0:n]will give you all the columns of the row i. In fact, this returns the columns 0in nfrom the row i.
You should use a loop to get the column:
func boardColumn(board [][]char, columnIndex int) (column []char) {
column = make([]char, 0)
for _, row := range board {
column = append(column, row[columnIndex])
}
return
}
The code you call "String" is actually the code that I would expect to deliver columns:
win[i] = check(BOARD[0:SIZE][i])
: i - SIZE.
, , Go -. :
x := [][]int{{1,2,3},{4,5,6}}
fmt.Println(x[0:2]) // [[1,2,3],[4,5,6]]
fmt.Println(x[0:2][0]) // [1,2,3]
, x[0:2] 2d-.
2d-.