From 1ecbde8dfce75600b2ac3e1c65d3a2c9826e90c3 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 13 Jul 2026 12:29:43 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Add=20explicit=20empt?= =?UTF-8?q?y=20state=20for=20highscore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When no highscore exists, show an encouraging empty state rather than just hiding the element. This clarifies system capabilities for new users. Co-authored-by: EiJackGH <172181576+EiJackGH@users.noreply.github.com> --- .Jules/palette.md | 3 +++ .gitignore | 1 + src/main.cpp | 2 ++ 3 files changed, 6 insertions(+) diff --git a/.Jules/palette.md b/.Jules/palette.md index 05d4366..7b26c95 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-07-13 - Empty States in CLI +**Learning:** Hiding UI elements (like high scores) when data is absent leaves users guessing if the feature exists. Providing an explicit, encouraging empty state clarifies system capabilities and improves onboarding. +**Action:** Always provide explicit empty states for data or achievements rather than hiding the UI element when empty. diff --git a/.gitignore b/.gitignore index eb2c19a..d07c78a 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,4 @@ highscore.txt # Persistent data highscore.txt +venv/ diff --git a/src/main.cpp b/src/main.cpp index 60ae556..4cee545 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 - go set a record!" << CLR_RESET << "\n\n"; } std::cout << "Controls:\n " << CLR_CTRL << "[h]" << CLR_RESET << " Toggle Hard Mode (10x Speed!)\n "