Skip to content

Commit

Permalink
оформил закрывающие уровни (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
Geksanit committed Jan 30, 2018
1 parent 2058c6a commit a9f3b1e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions frontend/mvc/model/Model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,18 @@ class Model implements IModel{
}
calculateMatrix(): void {
this.matrix = this.matrix.map((row: boolean[], i: number) =>
row.map((cell: boolean, j: number) => this.calculateCell(i, j)));
row.map((cell: boolean, j: number) => this.calculateCell(i, j)),
);
this.matrixChanged.notify({ matrix: this.matrix });
}
isRepeatMatrix(): boolean {
const result: boolean = this.listOldMatrix.some((matrix: boolean[][]) =>
matrix.every((row: boolean[], i: number) =>
row.every((cell: boolean, j: number) =>
(cell === this.matrix[i][j]))));
(cell === this.matrix[i][j]),
),
),
);
if (result) this.listOldMatrix = [];
else this.listOldMatrix.push(this.matrix);
return result;
Expand Down

0 comments on commit a9f3b1e

Please sign in to comment.