Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 499f4cc

Browse files
author
programmiri
committed
begin matrix excercise
1 parent af6907c commit 499f4cc

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

‎matrix/matrix.js‎

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
//
2-
// This is only a SKELETON file for the 'Matrix' exercise. It's been provided as a
3-
// convenience to get you started writing code faster.
4-
//
5-
61
export class Matrix {
7-
constructor() {
8-
throw new Error("Remove this statement and implement this function");
2+
constructor(string) {
3+
this.matrix = string;
4+
}
5+
6+
splitInRows() {
7+
8+
const rowsFirst = this.matrix.split('\n').map( entry => entry.split(''))
9+
// .map( entry => parseInt(entry))
10+
console.log(rowsFirst)
911
}
1012

1113
get rows() {
12-
throw new Error("Remove this statement and implement this function");
14+
const test = this.splitInRows()
15+
// console.log(this.splitInRows())
16+
return test
1317
}
1418

1519
get columns() {
16-
thrownewError("Remove this statement and implement this function");
20+
1721
}
1822
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /