# Khan/khan-exercises

refactors for D797

1 parent 69bc78b commit 0c7b1bc3aa2b5cd5bd36bbe19f24c9699b4a0ae2 Stephanie H. Chang committed Oct 4, 2012
Showing with 33 additions and 72 deletions.
2. +22 −65 exercises/scalar_matrix_multiplication.html
 @@ -22,6 +22,7 @@ randRange(-2, 4, ROWS, COLS) randRange(-2, 4, ROWS, COLS) randFromArray(["+", "-"]) + deepZipWith(2, function(a, b) { if (OPERATION === "+") { @@ -31,17 +32,22 @@ } }, MAT_A, MAT_B) + + BLUE + GREEN + PINK + - printMatrix(MAT_A, BLUE) + printMatrix(MAT_A, MAT_A_COLOR) - printMatrix(MAT_B, GREEN) + printMatrix(MAT_B, MAT_B_COLOR) - printMatrix(MAT_A, BLUE, MAT_B, GREEN, OPERATION) + printMatrix(MAT_A, MAT_A_COLOR, MAT_B, MAT_B_COLOR, OPERATION) - printMatrix(SOLN_MAT, PINK) + printMatrix(SOLN_MAT, SOLN_MAT_COLOR) @@ -64,9 +70,7 @@ the corresponding items between each matrix.

-

- \Large{PRETTY_HINT_MAT} -

+ \Large{PRETTY_HINT_MAT}
 @@ -18,7 +18,7 @@
- randRange(-5, 10, ROWS, COLS) + randRange(-2, 4, ROWS, COLS) randRange(-5, 5) "*" @@ -27,15 +27,16 @@ }, MAT_A) - KhanUtil.BLUE - KhanUtil.GREEN - KhanUtil.RED deepZipWith(2, function(a) { return SCALAR; }, MAT_A) + BLUE + GREEN + PINK + printMatrix(MAT_A, MAT_A_COLOR) @@ -48,26 +49,20 @@
-
- init({ - range: [ [0, 12], [-1, 1] ] - }); - - var color = "\\color{" + SCALAR_COLOR + "}{" + SCALAR + "}"; - - label( [0, 0], - "\\Large{" + color + OPERATION + PRETTY_MAT_A + " = {?}}", - "right" ); -
+ + \Large{ + \color{SCALAR_COLOR}{SCALAR} + OPERATION + PRETTY_MAT_A = {?} + } +

To multiply a matrix by a number, multiply each item of the matrix by the number.

-

- \Large{PRETTY_HINT_MAT} -

+ \Large{PRETTY_HINT_MAT}
@@ -78,82 +73,44 @@
+
+

+ + elem + +

+
+
2 2
-
-

- SOLN_MAT[0][0] - SOLN_MAT[0][1] -

-

- SOLN_MAT[1][0] - SOLN_MAT[1][1] -

-
2 3
-
-

- SOLN_MAT[0][0] - SOLN_MAT[0][1] - SOLN_MAT[0][2] -

-

- SOLN_MAT[1][0] - SOLN_MAT[1][1] - SOLN_MAT[1][2] -

-
3 1
-
-

- SOLN_MAT[0][0] -

-

- SOLN_MAT[1][0] -

-

- SOLN_MAT[2][0] -

-
3 2
-
-

- SOLN_MAT[0][0] - SOLN_MAT[0][1] -

-

- SOLN_MAT[1][0] - SOLN_MAT[1][1] -

-

- SOLN_MAT[2][0] - SOLN_MAT[2][1] -

-
+