It's just a rotation on a single column or a single row. This means you would shift the items one position with wrap around.
It’s an interesting question for HN, so you should try resubmitting it
Perhaps there are some useful ideas in this code: https://www.chiark.greenend.org.uk/~sgtatham/puzzles