diff --git a/.Jules/palette.md b/.Jules/palette.md index 05d4366..fa942bf 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-07-02 - Explicit Empty States for Achievements +**Learning:** In CLI applications, hiding achievement sections (like personal bests) when empty can leave new users confused about the system state. Providing an explicit, encouraging empty state clarifies that achievements exist and incentivizes onboarding. +**Action:** Always provide encouraging empty state messages (e.g., "None yet! Play to set one!") instead of completely hiding the UI elements when data is empty. diff --git a/src/main.cpp b/src/main.cpp index 60ae556..34ab604 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! Play to set one!" << CLR_RESET << "\n\n"; } std::cout << "Controls:\n " << CLR_CTRL << "[h]" << CLR_RESET << " Toggle Hard Mode (10x Speed!)\n "