Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@
## 2024-05-20 - Dynamic Progress Bar for Quiet CLI Tasks
**Learning:** For long-running CLI processes that suppress verbose logging (e.g., `--quiet`), users lose system status visibility.
**Action:** Implemented a dynamic progress bar using `\r` and `flush=True`, conditional on `sys.stdout.isatty()`, to provide status feedback without polluting non-interactive logs.

## 2025-03-05 - C++ CLI Formatting
**Learning:** Using standard ASCII box-drawing characters alongside `<iomanip>` formatting (`setw`) and ANSI color constants creates structured, dashboard-like CLI experiences in C++ applications. Emojis and visual distinctness greatly improve the UX.
**Action:** When summarizing results in C++ CLI tools, utilize this combination to highlight success states and crucial metrics rather than printing basic lists.
37 changes: 28 additions & 9 deletions NumberGuess/NumberGuess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,23 @@
#include <cstdlib> // For rand() and srand()
#include <ctime> // For time()
#include <string>
#include <iomanip>

using namespace std;

// ANSI Color Constants for UX
const string RESET = "\033[0m";
const string BOLD = "\033[1m";
const string GREEN = "\033[32m";
const string YELLOW = "\033[33m";
const string BLUE = "\033[34m";
const string CYAN = "\033[36m";
const string RED = "\033[31m";


void showEasterEgg() {
cout << "\n[!] EASTER EGG ACTIVATED: THE ZEN MODE" << endl;
cout << "\n" << BOLD << CYAN << "[✨] EASTER EGG ACTIVATED: THE ZEN MODE" << RESET << endl;

cout << "Inspired by the Word 1.1a secret found 29 years later." << endl;
cout << "EiJackGH Lab - Saying YES in 2026." << endl;
cout << "========================================" << endl;
Expand All @@ -21,9 +33,9 @@ int main() {
int guess = 0;
int attempts = 0;

cout << "--- EI-JACK LAB: NUMBER GUESSER V1.0 ---" << endl;
cout << BOLD << BLUE << "--- EI-JACK LAB: NUMBER GUESSER V1.0 ---" << RESET << endl;
cout << "I'm thinking of a number between 1 and 100." << endl;
cout << "(Hint: Type 'zen' to see the credits)" << endl << endl;
cout << YELLOW << "(Hint: Type 'zen' to see the credits)" << RESET << endl << endl;

while (guess != secretNumber) {
cout << "Enter your guess: ";
Expand All @@ -39,23 +51,30 @@ int main() {
try {
guess = stoi(input);
} catch (...) {
cout << "Invalid input. Please enter a number." << endl;
cout << RED << "⚠️ Invalid input. Please enter a number." << RESET << endl;
continue;
}

attempts++;

if (guess > secretNumber) {
cout << ">>> Too high! Try again." << endl;
cout << RED << "πŸ“ˆ Too high! Try again." << RESET << endl;
} else if (guess < secretNumber) {
cout << ">>> Too low! Try again." << endl;
cout << BLUE << "πŸ“‰ Too low! Try again." << RESET << endl;
} else {
cout << "\nCONGRATULATIONS!" << endl;
cout << "You found it in " << attempts << " attempts." << endl;

cout << "\n" << BOLD << GREEN << "╔════════════════════════════════════════╗" << endl;
cout << "β•‘ " << RESET << "πŸŽ‰ CONGRATULATIONS! πŸŽ‰ " << BOLD << GREEN << "β•‘" << endl;
cout << "╠════════════════════════════════════════╣" << endl;
cout << "β•‘ " << RESET << "You found the secret number in: " << setw(4) << attempts << BOLD << GREEN << " β•‘" << endl;
cout << "β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•" << RESET << endl;

}
}

cout << "----------------------------------------" << endl;
system("pause"); // Essential for Dev-C++ to keep the window open
cout << "\nPress Enter to exit..." << endl;
cin.ignore(10000, '\n'); // Ignore any remaining characters in the buffer
cin.get(); // Wait for the user to press Enter
return 0;
}
Loading