Skip to content

Commit

Permalink
feat: fill matrix table in matrixPlayground page
Browse files Browse the repository at this point in the history
  • Loading branch information
Kywal committed Nov 26, 2023
1 parent c54e3fd commit 8ee31ab
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scripts/matrixGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,19 @@ function generateMatrixInput() {
}

function fillMatrix() {
const lines = sessionStorage.getItem("lines");
const columns = sessionStorage.getItem("columns");
const linesAmount = Number(lines);
const columnsAmount = Number(columns);

const matrixString = sessionStorage.getItem("matrix");
const matrix = jsonToMatrix(matrixString);

for (let i = 0; i < linesAmount; i++) {
for (let j = 0; j < columnsAmount; j++) {
document.getElementById(String(i) + String(j)).value = matrix[i][j];
}
}
}

/**
Expand Down

0 comments on commit 8ee31ab

Please sign in to comment.