Bug fixes

This commit is contained in:
Oystein Kristoffer Tveit 2020-06-09 18:24:49 +02:00
parent c0b32b4175
commit 99912595e6
1 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ function makeNumberRow(xLength) {
return `${numberRow.join(' & ')} \\\\\n\\hline\n\\endhead\n`; return `${numberRow.join(' & ')} \\\\\n\\hline\n\\endhead\n`;
} }
function kanjiRow(index, kanjiArray) { function kanjiRow(index, rowLength, kanjiArray) {
let result = []; let result = [];
for (let rowIndex = 0; rowIndex < rowLength; rowIndex++) { for (let rowIndex = 0; rowIndex < rowLength; rowIndex++) {
const currentIndex = index + rowIndex; const currentIndex = index + rowIndex;
@ -20,14 +20,14 @@ function kanjiRow(index, kanjiArray) {
function makeRows(rowLength, columnLength, kanjiArray) { function makeRows(rowLength, columnLength, kanjiArray) {
let result = ''; let result = '';
for (let columnIndex = 0; columnIndex < columnLength; columnIndex++) { for (let columnIndex = 0; columnIndex < columnLength; columnIndex++) {
const line = new Array; let line = new Array;
const index = columnIndex * rowLength; const index = columnIndex * rowLength;
// Add the number of current character // Add the number of current character
line.push(`{\\large ${index}}`); line.push(`{\\large ${index}}`);
// Concatenate the number with the rest of the row // Concatenate the number with the rest of the row
line = [line, kanjiRow(index, kanjiArray)]; line = [line, kanjiRow(index, rowLength, kanjiArray)];
// Convert the line array into a tex row and add it to result. // Convert the line array into a tex row and add it to result.
result += `${line.join(' & ')} \\\\\n`; result += `${line.join(' & ')} \\\\\n`;