Is there a way I can access individual elements of a row using the map function? I basically have a grid, and I need to return the row and column index each time I find a 0. The code shown below shows how I used the map function to return the index of the row. Not I need to return the index of the column (i.e. the index of EACH element in that row). I am new to Scala so I'll appreciate any form help :-)
def indices = sudoku.grid.map{
row=>row.map{
case 0=> sudoku.grid.indexOf(row) //this returns the index of the row. I need to return the index of the column(i.e. current element being accessed)
case element=> element //
}
}