let next_coordinates riddle table prev_row prev_col =
let row = ref prev_row in
let col = ref prev_col in
let next_coord () =
if !col = table.col_nb - 1 then
(col := 0; incr row;) else (incr col;) in
next_coord ();
while riddle.(!row).(!col) <> (-1, -1) do
next_coord ();
done;
(!row, !col)