From 5140b9e457468b4f61603a8a043b42a0f629993c Mon Sep 17 00:00:00 2001 From: Kostya Date: Sun, 21 Jan 2024 12:44:32 +0300 Subject: [PATCH] refactor logic for findX --- luckydiamond/src/pages/games-pages/SapergamePage.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luckydiamond/src/pages/games-pages/SapergamePage.vue b/luckydiamond/src/pages/games-pages/SapergamePage.vue index 346cf8d..59a6a3a 100644 --- a/luckydiamond/src/pages/games-pages/SapergamePage.vue +++ b/luckydiamond/src/pages/games-pages/SapergamePage.vue @@ -230,9 +230,9 @@ export default { let findIndex, findX, findY if (X_Cordinates > 5) { - findIndex = Math.ceil(X_Cordinates / 5) * 5 - 1 + findIndex = Math.ceil(X_Cordinates / 5) * 5 findY = Math.ceil(findIndex / 5) - 1 - findX = X_Cordinates % 5 + findX = Math.ceil(X_Cordinates / 5 - 1) console.log(findX, findY) } else if (X_Cordinates <= 5) {