diff --git a/.Jules/palette.md b/.Jules/palette.md index 96bd45d..1341145 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -5,3 +5,7 @@ ## 2025-02-28 - Structured CLI Reports **Learning:** Dense numerical data in CLI output is hard to parse. Using ASCII box-drawing characters and alignment to create a "dashboard" or "invoice" style summary significantly improves readability and perceived quality. **Action:** When summarizing simulation or batch job results, always format the final report as a structured table or box rather than a list of print statements. + +## 2025-03-16 - Interactive CLI Progress Indicators +**Learning:** For long-running CLI processes that suppress verbose logging (e.g., `--quiet` mode), users can become anxious and terminate the script prematurely if there is no visual feedback. +**Action:** Implement a dynamic progress bar using `\r` and `flush=True` (conditional on `sys.stdout.isatty()`) to provide system status visibility without polluting standard output logs or breaking non-interactive environments. diff --git a/Dockerfile b/Dockerfile index ff6e936..3eeac40 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ FROM gcc:latest WORKDIR /usr/src/app # Copy your C++ file into the container -COPY NumberGuess.cpp . +COPY NumberGuess/NumberGuess.cpp . # Compile the code RUN g++ -o NumberGuess NumberGuess.cpp diff --git a/bitcoin_trading_simulation.py b/bitcoin_trading_simulation.py index cb07d20..655a9fa 100644 --- a/bitcoin_trading_simulation.py +++ b/bitcoin_trading_simulation.py @@ -84,7 +84,17 @@ def simulate_trading(signals, initial_cash=10000, quiet=False): if not quiet: print(f"\n{Colors.HEADER}{Colors.BOLD}------ Daily Trading Ledger ------{Colors.ENDC}") - for i, row in signals.iterrows(): + + total_days = len(signals) + show_progress = quiet and sys.stdout.isatty() + for idx, (i, row) in enumerate(signals.iterrows()): + if show_progress: + progress = int(50 * (idx + 1) / total_days) + bar = '█' * progress + '-' * (50 - progress) + print(f"\r{Colors.CYAN}Simulating: [{bar}] {idx + 1}/{total_days} days{Colors.ENDC}", end="", flush=True) + if idx + 1 == total_days: + print() + if i > 0: portfolio.loc[i, 'cash'] = portfolio.loc[i-1, 'cash'] portfolio.loc[i, 'btc'] = portfolio.loc[i-1, 'btc'] diff --git a/main.tf b/main.tf new file mode 100644 index 0000000..75db792 --- /dev/null +++ b/main.tf @@ -0,0 +1 @@ +terraform {}