matrix-in-spiral
v0.1.2
Published
Print a given matrix in spiral
Downloads
1
Readme
MatrixInSpiral
How to use
npm i -S matrix-in-spiral
var matrix = require('matrix-in-spiral');
console.log(matrix.MatrixInSpiral(5));
Will create matrix:
0, 1, 2, 3, 4
5, 6, 7, 8, 9
10, 11, 12, 13, 14
15, 16, 17, 18, 19
20, 21, 22, 23, 24
Will print matrix in spiral:
[ 0,1,2,3,4,9,14,19,24,23,22,21,20,15,10,5,6,7,8,13,18,17,16,11,12 ]