Skip to content

Commit 25c4dcc

Browse files
committed
Simplify block memory challenge scoring
1 parent 231995c commit 25c4dcc

7 files changed

Lines changed: 149 additions & 246 deletions

File tree

app/[locale]/(main)/games/block-memory-challenge/components/PatternRecallGame.tsx

Lines changed: 138 additions & 233 deletions
Large diffs are not rendered by default.

app/[locale]/(main)/games/block-memory-challenge/page.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { getTranslations, setRequestLocale } from "next-intl/server";
1111
import { use } from "react";
1212
import { routing } from '@/i18n/routing';
1313
import { generateAlternates } from "@/lib/utils";
14-
import { RANKED_LEADERBOARD_MODE } from "@/lib/leaderboard-config";
1514

1615
// Generate static params for all locales
1716
export function generateStaticParams() {
@@ -84,10 +83,10 @@ export default function BlockMemoryPage({ params }: { params: Promise<{ locale:
8483
"priceCurrency": "USD"
8584
},
8685
"featureList": [
87-
"Ranked mode with a fixed starting level",
88-
"Practice mode with adjustable sequence length",
89-
"Visual working memory training",
90-
"Anonymous leaderboard"
86+
"Single-mode score attack gameplay",
87+
"Adjustable starting sequence length",
88+
"Score-based leaderboard",
89+
"Visual working memory training"
9190
],
9291
"educationalUse": "Working Memory Training",
9392
"learningResourceType": "Interactive Game",
@@ -185,8 +184,7 @@ export default function BlockMemoryPage({ params }: { params: Promise<{ locale:
185184
faq={faq}
186185
relatedGames={["frog-memory-leap", "schulte-table"]}
187186
hasLeaderboard={true}
188-
leaderboardFormatterType="levels"
189-
leaderboardMode={RANKED_LEADERBOARD_MODE}
187+
leaderboardFormatterType="pts"
190188
structuredData={structuredData}
191189
/>
192190
);

app/api/leaderboard/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ function validateScore(
209209
case "fish-trace":
210210
return score > 50000 ? "Score rejected" : null;
211211
case "block-memory-challenge":
212-
if (!Number.isInteger(score) || score < 1 || score > 100) {
213-
return "Score rejected (Invalid ranked level)";
212+
if (!Number.isInteger(score) || score < 1 || score > 50000) {
213+
return "Score rejected (Invalid score)";
214214
}
215215
return null;
216216
case "schulte-table":

messages/en/compiled.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@
10741074
"practiceMode": "Practice",
10751075
"rankedDescription": "Fixed start level. Leaderboard tracks the highest completed level.",
10761076
"practiceDescription": "Choose any starting sequence length. Practice runs stay local and do not affect the leaderboard.",
1077-
"leaderboardDescription": "The ranked leaderboard compares the highest completed level only, so every player starts from the same difficulty.",
1077+
"leaderboardDescription": "The leaderboard compares total score. You can choose your starting level, and higher levels are worth more points.",
10781078
"rankedResult": "Ranked Result",
10791079
"highestLevelReached": "Highest Level Reached",
10801080
"noLevelCompleted": "No level completed yet",

messages/en/games.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@
683683
"practiceMode": "Practice",
684684
"rankedDescription": "Fixed start level. Leaderboard tracks the highest completed level.",
685685
"practiceDescription": "Choose any starting sequence length. Practice runs stay local and do not affect the leaderboard.",
686-
"leaderboardDescription": "The ranked leaderboard compares the highest completed level only, so every player starts from the same difficulty.",
686+
"leaderboardDescription": "The leaderboard compares total score. You can choose your starting level, and higher levels are worth more points.",
687687
"rankedResult": "Ranked Result",
688688
"highestLevelReached": "Highest Level Reached",
689689
"noLevelCompleted": "No level completed yet",

messages/zh/compiled.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,7 @@
12871287
"practiceMode": "练习",
12881288
"rankedDescription": "固定起始难度。排行榜只比较你完成的最高关卡。",
12891289
"practiceDescription": "你可以自由选择起始序列长度。练习成绩只保存在本地,不影响排行榜。",
1290-
"leaderboardDescription": "排位榜只比较完成的最高关卡,所有玩家都从同样的难度开始",
1290+
"leaderboardDescription": "排行榜只比较总分。你可以自己选择起始阶数,起点越高,每关分值也越高",
12911291
"rankedResult": "排位结果",
12921292
"highestLevelReached": "最高完成关卡",
12931293
"noLevelCompleted": "还没有完成任何关卡",

messages/zh/games.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@
896896
"practiceMode": "练习",
897897
"rankedDescription": "固定起始难度。排行榜只比较你完成的最高关卡。",
898898
"practiceDescription": "你可以自由选择起始序列长度。练习成绩只保存在本地,不影响排行榜。",
899-
"leaderboardDescription": "排位榜只比较完成的最高关卡,所有玩家都从同样的难度开始",
899+
"leaderboardDescription": "排行榜只比较总分。你可以自己选择起始阶数,起点越高,每关分值也越高",
900900
"rankedResult": "排位结果",
901901
"highestLevelReached": "最高完成关卡",
902902
"noLevelCompleted": "还没有完成任何关卡",

0 commit comments

Comments
 (0)