diff --git a/.Jules/palette.md b/.Jules/palette.md index 8ee612f..cf09dc8 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -12,3 +12,7 @@ ## 2025-03-23 - Game Key Scrolling **Learning:** Browsers natively scroll the page when users press Space or Arrow keys. When building a web-based game, this creates a frustrating UX where the game viewport jumps around while playing. **Action:** Always call `e.preventDefault()` on keydown events for typical game controls ("Space", "ArrowUp", etc.) when the focus is on a game container or the body. + +## 2023-10-25 - Cross-Platform CLI Exit Prompt +**Learning:** Using OS-specific commands like system("pause") for basic UX features breaks usability on other platforms and lacks clear accessibility instruction. +**Action:** Replace system("pause") with standard input stream functions (cin.get()) paired with explicit instructional text (e.g., "Press Enter to exit...") to ensure consistent, accessible behavior across all platforms. diff --git a/NumberGuess/NumberGuess.cpp b/NumberGuess/NumberGuess.cpp index c82e2f8..2831c59 100644 --- a/NumberGuess/NumberGuess.cpp +++ b/NumberGuess/NumberGuess.cpp @@ -56,6 +56,9 @@ int main() { } cout << "----------------------------------------" << endl; - system("pause"); // Essential for Dev-C++ to keep the window open + cout << "Press Enter to exit..." << endl; + cin.clear(); + cin.ignore(10000, '\n'); + cin.get(); return 0; } diff --git a/requirements.txt b/requirements.txt index cfaa995..4ad1501 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ numpy pandas requests -venv