From 87552a82f6133bd3c80a40ec693bd3e3cd665f61 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 11 Apr 2026 14:06:48 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Replace=20OS-spec?= =?UTF-8?q?ific=20pause=20with=20cross-platform=20explicit=20prompt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaced the Windows-specific `system("pause")` call in `NumberGuess/NumberGuess.cpp` with standard C++ `cin.get()` along with an explicit "Press Enter to exit..." instruction. This improves cross-platform consistency and accessibility. Recorded UX learning in `.Jules/palette.md`. Co-authored-by: EiJackGH <172181576+EiJackGH@users.noreply.github.com> --- .Jules/palette.md | 4 ++++ NumberGuess/NumberGuess.cpp | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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; } From 8bd5b65b5acaae3368462a8d9ad1a0fbf54acc8c Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 11 Apr 2026 14:13:02 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Replace=20OS-spec?= =?UTF-8?q?ific=20pause=20with=20cross-platform=20explicit=20prompt=20and?= =?UTF-8?q?=20fix=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaced the Windows-specific `system("pause")` call in `NumberGuess/NumberGuess.cpp` with standard C++ `cin.get()` along with an explicit "Press Enter to exit..." instruction. This improves cross-platform consistency and accessibility. Recorded UX learning in `.Jules/palette.md`. Also removed `venv` from `requirements.txt` to fix CI failures, as `venv` is a standard module that should not be pip-installed. Co-authored-by: EiJackGH <172181576+EiJackGH@users.noreply.github.com> --- requirements.txt | 1 - 1 file changed, 1 deletion(-) 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