Create for loops that spiral from the center or a given point
npm install spiralloopjs
npm install spiralloop
`Usage
spiral(Lengths, [Center], Function)
$3
An array of the lengths of your loop, such as [4, 4] or [5, 3, 7]. Handles array lengths as long as you'd like.$3
The default center is in the middle (1.5, 1.5 of a 3x3) but feel free to change this up.$3
A function that will give paramaters of the current value. For example:
`
function(x, y, z) { }
`
If you return true in this function, it will act as a "break".Example
`js
var spiral = require('spiralloop');spiral([3, 3], function(x, y) {
console.log(x + ', ' + y);
});
``