From 6c587cadb2adfab60506c3cc835b5c8d5c102023 Mon Sep 17 00:00:00 2001 From: Kostya Date: Sun, 21 Jan 2024 13:02:39 +0300 Subject: [PATCH] refactor logic for the formula findX, saper --- 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 324af74..787eaea 100644 --- a/luckydiamond/src/pages/games-pages/SapergamePage.vue +++ b/luckydiamond/src/pages/games-pages/SapergamePage.vue @@ -232,11 +232,11 @@ export default { if (X_Cordinates > 5) { findIndex = Math.ceil(X_Cordinates / 5) * 5 findY = Math.ceil(findIndex / 5) - 1 - findX = Math.ceil(X_Cordinates / 5 - 1) + findX = X_Cordinates - findIndex + 4 console.log(findX, findY) } else if (X_Cordinates <= 5) { - findX = X_Cordinates + findX = X_Cordinates - 1 findY = 1 }