Skip to content

Instantly share code, notes, and snippets.

@alejandrolechuga
Created February 12, 2018 23:39
Show Gist options
  • Save alejandrolechuga/856aacc3c653cd2bcccecc0ff4c6b558 to your computer and use it in GitHub Desktop.
Save alejandrolechuga/856aacc3c653cd2bcccecc0ff4c6b558 to your computer and use it in GitHub Desktop.
function generateMatrix(n) {
var matrix = []
for (var i = 0 ;i < n; i++ ) {
var row = []
for (var j = 0; j < n; j++ ) {
row.push(0);
}
matrix.push(row);
}
return matrix;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment