Javascript – Snail generation of a matrix of "n" numbers where "n" is perfect square
I was trying to solve the following problem: Given an odd integer "n" such that √(n)^2 = n (perfect square), ex. 1, 9, 25, 49, 81... Generate a matrix of n coordinates (x, y) occurrences This is my solution: //…