Skip to content

Commit

Permalink
удалены ненужные комментарии (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
Geksanit committed Jan 13, 2018
1 parent 2048ac3 commit 11daf50
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion frontend/mvc/controller/Controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Controller {
this.view.setStatus(this.running);
}
anim(callback?): void {
// останавливается и вызывет аргумент callback(для тестов), когда матрица перестает меняться
// останавливается и вызывет callback(для тестов), когда матрица перестает меняться
const self = this;
const loop = () => {
setTimeout(() => {
Expand Down
9 changes: 3 additions & 6 deletions frontend/mvc/model/Model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ class Model {
for (let j = 0; j < this.columns; j += 1) {
newRow.push(false);
}
// копию новой пустой строки вставляем нужное число раз
for (let i = oldValue; i < newValue; i += 1) {
matrix.push(newRow.slice());
}
Expand All @@ -80,7 +79,7 @@ class Model {
const flag: boolean = this.isRepeatMatrix(newMatrix);
this.matrix = newMatrix;
this.matrixChanged.notify({ matrix: this.matrix });
return flag;// повторилась матрица?
return flag;
}
isRepeatMatrix(newMatrix): boolean {
const flag: boolean = this.listOldMatrix.some((matrix: boolean[][]) =>
Expand All @@ -98,13 +97,11 @@ class Model {
const { matrix } = this;
const indexes: number[] = [-1, 0, 1];

// обход окресности ячейки
indexes.forEach((i: number) => {
const indexRow = row + i;// строка может не существовать
const indexRow = row + i;
if (matrix[indexRow]) {
indexes.forEach((j: number) => {
const indexCell = column + j;// ячейка тоже может не существовать
// вычисляемая ячейка не считается
const indexCell = column + j;
if (matrix[indexRow][indexCell] && (i !== 0 || j !== 0)) count += 1;
});
}
Expand Down
1 change: 0 additions & 1 deletion frontend/mvc/view/View.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class View {
else this.status.classList.add('status_stopped');
}
getNewTbody(matrix: boolean[][], tableWidth: number): HTMLTableSectionElement {
// заполнение тела таблицы
const columns: number = matrix[0].length;
const size: number = tableWidth / columns;
let tbody: HTMLTableSectionElement = document.createElement('tbody');
Expand Down

0 comments on commit 11daf50

Please sign in to comment.