From da630b14aafa675c9ce8e8590d6b53c241a48db2 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 24 Aug 2026 12:24:41 +0000 Subject: [PATCH] Add explicit empty state for highscore Co-authored-by: EiJackGH <172181576+EiJackGH@users.noreply.github.com> --- .Jules/palette.md | 3 +++ src/main.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/.Jules/palette.md b/.Jules/palette.md index 05d4366..753fa87 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -33,3 +33,6 @@ ## 2024-04-24 - Avoiding Trailing Artifacts in CLI Applications **Learning:** When dynamically updating terminal lines using carriage return (`\r`), relying on hardcoded padding spaces to overwrite old text is brittle and leads to trailing text artifacts when new lines are shorter than previous ones. **Action:** Always use the ANSI escape sequence `\033[K` (Erase in Line) immediately after the carriage return (`\r`) to cleanly clear the line before writing new content, rather than manually managing padding spaces. +## 2024-05-18 - Explicit Empty State for Highscore +**Learning:** Hiding the high score when it is 0 leaves new users without a clear goal or understanding of the achievement system. +**Action:** Provide explicit, encouraging empty states for data or achievements rather than hiding the UI element when empty, to clarify system state and improve user onboarding. diff --git a/src/main.cpp b/src/main.cpp index b9144b7..d43524c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -80,6 +80,8 @@ int main() { if (highscore > 0) { std::cout << " Personal Best: " << CLR_SCORE << formatWithCommas(highscore) << CLR_RESET << "\n\n"; + } else { + std::cout << " Personal Best: " << CLR_SCORE << "None yet! Go set a record!" << CLR_RESET << "\n\n"; } std::cout << "Controls:\n " << CLR_CTRL << "[h]" << CLR_RESET << " Toggle Hard Mode (10x Speed!)\n "