Skip to content

Commit de72f93

Browse files
committed
2 parents d3cf56a + 677907b commit de72f93

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

app/models/matriz.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
class Matriz {
2+
constructor(rows, cols) {
3+
this.rows = rows;
4+
this.cols = cols;
5+
6+
this.data = [];
7+
8+
for (var i = 0; i < rows; i++) {
9+
var arr = [];
10+
for (var j = 0; j < cols; j++) {
11+
arr.push(0);
12+
}
13+
this.data.push(arr);
14+
}
15+
}
16+
17+
print() {
18+
console.table(this.data);
19+
}
20+
}
21+
22+
module.exports = Matriz;

0 commit comments

Comments
 (0)