I have 2 arrays. I want to convert the index of the first array to the second. Is there a better way to do it than what I have below?
Array array1[9]; Array
Just in case someone wonders for Javascript.
var columnCount = 3 for(var i=0; i < 10; i++){ var row = Math.floor(i/ columnCount ) var col = i % columnCount console.log(i, row, col) }