Skip to content

Instantly share code, notes, and snippets.

View MrMizerakl's full-sized avatar

MrMizerakl

  • Ua, Sosnitsa
View GitHub Profile
@MrMizerakl
MrMizerakl / getSpiralMatrix.js
Last active October 20, 2016 00:12
getSpiralMatrix
const getSpiralMatrix = (rows, columns) => {
let arr = [], i=0, j=0, iterI=0, iterJ=0;
for(let i=0;i<rows;i++){
arr[i] = [];
}
for(let zn=1;zn<=rows*columns;zn++){
if(i == iterI){
arr[i][j] = zn;
j++;