'use strict';

const Integer = require('./integer');

const random = (N, ratio, min, max) => {
  if (!N) N = 5;
  if (!ratio) ratio = .3;
  if (!min) min = 1;
  if (!max) max = 5;
  var G = new Array(N);
  for (var i = 0; i < N; i++) {
    G[i] = new Array(N);
    for (var j = 0; j < N; j++) {
      if (i != j && (Math.random() * (1 / ratio) | 0) == 0) {
        G[i][j] = Integer.random(min, max);
      }
    }
  }
  return G;
};

module.exports = {
  random
};
