From 13aff6ec1198a4fc3cf8248b9f4233a57ca35edf Mon Sep 17 00:00:00 2001 From: Dominik Rabsch <62121818+domonik@users.noreply.github.com> Date: Fri, 13 Oct 2023 18:00:37 +0200 Subject: [PATCH] fixed recursion bug --- assets/js/recursions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/recursions.js b/assets/js/recursions.js index db1cac7..151da2a 100644 --- a/assets/js/recursions.js +++ b/assets/js/recursions.js @@ -151,7 +151,7 @@ function checkMaxMatrix(){ console.log(maxTable.rows[1].cells[2].children[0].value) first = parseInt(maxTable.rows[1].cells[1].children[0].value) + 2; second = parseInt(maxTable.rows[1].cells[2].children[0].value) + 3; - third = parseInt(maxTable.rows[1].cells[2].children[0].value) + 1; + third = parseInt(maxTable.rows[2].cells[1].children[0].value) + 1; result = Math.max(first, second, third); cellElement = maxTable.rows[2].cells[2]; current = parseInt(cellElement.children[0].value);