Шрифт
Фон
{
var n = this.intRand(this.rowCount * this.colCount‑1);
if (res[n] != 1)
{
res[n] = 1;
mines--;
}
}
return res;
}
this.hasMine = function(i, j)
{
if ((i < 0) || (j < 0) || (i >= this.rowCount) || (j >= this.colCount))
return 0;
if (this.mines[i * this.rowCount + j] == 1)
return 1;
return 0;
}
this.checkCell = function(i, j)
{
if (this.hasMine(i, j))
return '*';
Шрифт
Фон