matrix-in-spiral

0.1.2 • Public • Published

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 ]

Readme

Keywords

none

Package Sidebar

Install

npm i matrix-in-spiral

Weekly Downloads

0

Version

0.1.2

License

ISC

Last publish

Collaborators

  • axiomaswn