diff --git a/hw/hw6/hw6.js b/hw/hw6/hw6.js index ec2eb2e..16a7b57 100644 --- a/hw/hw6/hw6.js +++ b/hw/hw6/hw6.js @@ -65,14 +65,14 @@ let temp = [] for (let n = 0; n < templates.length; n++) { temp.push([]) for (let i = 0; i < squareSize; i++) { - temp[n].push([]) + temp[n].push([]); for (let j = 0; j < squareSize; j++) { temp[n][i].push(templates[n][i][j] == "X" ? 1 : 0); } } } -templates = temp +templates = temp; const encodedMsg = "Р_НАЙА_СЛЗДЕ_ЛОСЖСТОИКНОЛЬЛЬТКУЮО__КЗАЕ_ДВАОКАЧОЖЗ_УЧАСМОДУ_ТЮЖЕ"; @@ -86,7 +86,7 @@ function rotateTemplate(template) { } } for (let i = 0; i < squareSize; i++) { - for (let j = 0; j < squareSize/2; j++) { + for (let j = 0; j < squareSize / 2; j++) { let temp = template[i][j]; template[i][j] = template[i][(squareSize - 1) - j]; template[i][(squareSize - 1) - j] = temp; @@ -95,8 +95,8 @@ function rotateTemplate(template) { } for (let n = 0; n < templates.length; n++) { + let out = "" for (let rot = 0; rot < 4; rot++) { - let out = "" for (let i = 0; i < squareSize; i++) { for (let j = 0; j < squareSize; j++) { if (templates[n][i][j]) { @@ -104,7 +104,9 @@ for (let n = 0; n < templates.length; n++) { } } } - console.log(out) - rotateTemplate(templates[n]) + rotateTemplate(templates[n]); } + console.log(out); + console.log("======="); + } \ No newline at end of file