Slices of Multidimensional Arrays?

    GetXYCells(ZIn : int) : ?[][]maze_cell =
        var MazeCells : [][]maze_cell = array{}
        if (set MazeCells = maze_cell[ZIn]):
            return Cells[ZIn]
        else:
            return none

So, I’d like to return a ‘slice’ of an array here. Can I do that somehow? It doesn’t seem like Verse supports it.

you’d have to return option{Cells[ZIn]} and also isn’t that just one array and not a 2D array you’d be returning?

Cells is a 3D array, so I want to return a 2D slice of it.

1 Like