When procedurally generating 2D maps, square algorithms can come in very handy. This little library provides you various ways of traversing squares. Check out the example project to see all the variations.
git clone [email protected]:lukezirngibl/square-algorithms.git
cd square-algorithms/example
yarn install
yarn start
yarn add square-algorithms
npm install square-algorithms