Skip to content

Instantly share code, notes, and snippets.

@denchistyakov
Created January 4, 2013 16:31
Show Gist options
  • Save denchistyakov/4453891 to your computer and use it in GitHub Desktop.
Save denchistyakov/4453891 to your computer and use it in GitHub Desktop.
Generating of matrix with length n with random number 0 or 1
function matrixFactory(n) {
return (new Array(n)).map(function() {
return (Math.random() > 0.5) ? 1 : 0;
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment