Generation

generate functionSun, 13 Nov 2022

Convert 1d array index to 2d

function get2dArrayPosition(x, y, width) { return y * width + x; } get2dArrayPosition(2, 3, 4)

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant