From 2a8a8f69e29a890a14083030c5c59e5a6ecd3cf4 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 5 Jul 2026 12:44:35 +0000 Subject: [PATCH] Add encouraging empty state for highscore display This commit adds an explicitly encouraging message ("None yet! Set a record!") when the user's high score is 0, rather than silently hiding the section. This improves the onboarding experience for new players by clarifying the system state and providing a friendly call-to-action. 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..7480139 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. + +## 2026-06-01 - Welcoming Empty States in CLI +**Learning:** In CLI applications, explicitly displaying encouraging empty states (e.g., "None yet! Set a record!") for data or achievements clarifies the system state and improves user onboarding, rather than silently hiding the UI element when empty. +**Action:** Always provide explicit, encouraging empty states for data or achievements to clarify system state and improve user onboarding. diff --git a/src/main.cpp b/src/main.cpp index 60ae556..9938143 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_NORM << "None yet! Set a record!" << CLR_RESET << "\n\n"; } std::cout << "Controls:\n " << CLR_CTRL << "[h]" << CLR_RESET << " Toggle Hard Mode (10x Speed!)\n "