Hacker News new | ask | show | jobs
by morelisp 1149 days ago
Board history does not matter.

    Grid.prototype.randomAvailableCell = function () {
      var cells = this.availableCells();

      if (cells.length) {
        return cells[Math.floor(Math.random() * cells.length)];
      }
    };