From e38fed67cb86f13b124adfd152436a430d8c0288 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 3 Jul 2026 12:24:00 +0000 Subject: [PATCH] Add explicit empty state for highscore This commit modifies the highscore display logic in `src/main.cpp`. Instead of completely hiding the personal best section when the highscore is 0, it now displays an encouraging empty state: "None yet! Set a record!". This clarifies the system state and game goal for first-time players. Co-authored-by: EiJackGH <172181576+EiJackGH@users.noreply.github.com> --- .Jules/palette.md | 4 ++++ src/main.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/.Jules/palette.md b/.Jules/palette.md index 05d4366..aef68e7 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -33,3 +33,7 @@ ## 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-23 - Empty States for Achievements +**Learning:** Hiding UI elements like a high score when empty can leave users confused about the system state and what they are working towards. Providing an explicit, encouraging empty state clarifies the goal and improves onboarding. +**Action:** Always provide explicit, encouraging empty states for data or achievements rather than hiding the UI element. diff --git a/src/main.cpp b/src/main.cpp index 60ae556..bd2b95d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -79,6 +79,8 @@ int main() { if (highscore > 0) { std::cout << " Personal Best: " << CLR_SCORE << highscore << CLR_RESET << "\n\n"; + } else { + std::cout << " Personal Best: " << CLR_SCORE << "None yet! Set a record!" << CLR_RESET << "\n\n"; } std::cout << "Controls:\n " << CLR_CTRL << "[h]" << CLR_RESET << " Toggle Hard Mode (10x Speed!)\n "