From b2fd11ba40df75008c4461540cec3ef110453960 Mon Sep 17 00:00:00 2001 From: Kartikay Gupta Date: Mon, 2 Feb 2026 07:00:53 +0530 Subject: [PATCH] Fixed C_BLUE import and f-string formatting causing {C_RESET} to appear in game screen --- terminal_games/arcade.py | 2 +- terminal_games/arcade_utils.py | 2 +- terminal_games/minesweeper.py | 4 ++-- terminal_games/tetris.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/terminal_games/arcade.py b/terminal_games/arcade.py index 43b8ff9..3df45fb 100644 --- a/terminal_games/arcade.py +++ b/terminal_games/arcade.py @@ -1,7 +1,7 @@ import os import sys import time -from arcade_utils import clear_screen, get_key, load_stats, draw_retro_box, beep, C_RESET, C_BOLD, C_RED, C_GREEN, C_YELLOW, C_CYAN, C_WHITE, C_MAGENTA +from arcade_utils import clear_screen, get_key, load_stats, draw_retro_box, beep, C_RESET, C_BOLD, C_RED, C_GREEN, C_YELLOW, C_CYAN, C_WHITE, C_MAGENTA, C_BLUE from sudoku import play_sudoku from minesweeper import play_minesweeper try: diff --git a/terminal_games/arcade_utils.py b/terminal_games/arcade_utils.py index c6bc6ca..e9a893f 100644 --- a/terminal_games/arcade_utils.py +++ b/terminal_games/arcade_utils.py @@ -158,7 +158,7 @@ def draw_retro_box(width, title, content_lines, color=C_CYAN, title_color=C_YELL # But standard print is easier. Let's trust the padding calc for now. print(indent + f"║{l_text}║") - print(indent + f"╚" + "═" * (width - 2) + "╝{C_RESET}") + print(indent + f"╚" + "═" * (width - 2) + f"╝{C_RESET}") def show_popup(msg, color=C_CYAN, delay=2): clear_screen() diff --git a/terminal_games/minesweeper.py b/terminal_games/minesweeper.py index 965ecd0..75efcc6 100644 --- a/terminal_games/minesweeper.py +++ b/terminal_games/minesweeper.py @@ -43,7 +43,7 @@ def print_board(board, revealed, flagged, cursor, elapsed, mines, exploded=None, border_color = C_RED if flash_red else C_CYAN - print(indent + f"{border_color}╔" + "═══" * cols + "═╗{C_RESET}") + print(indent + f"{border_color}╔" + "═══" * cols + f"═╗{C_RESET}") for r in range(rows): line = indent + f"{border_color}║{C_RESET} " @@ -62,7 +62,7 @@ def print_board(board, revealed, flagged, cursor, elapsed, mines, exploded=None, else: char = f"{style}{C_WHITE}■{C_RESET} " line += char + " " print(line + f"{border_color}║{C_RESET}") - print(indent + f"{border_color}╚" + "═══" * cols + "═╝{C_RESET}") + print(indent + f"{border_color}╚" + "═══" * cols + f"═╝{C_RESET}") controls = "ARROWS: Move | ENTER: Reveal | F: Flag | Q: Exit" ctrl_indent = (term_width - len(controls)) // 2 diff --git a/terminal_games/tetris.py b/terminal_games/tetris.py index b140821..7fe6f6a 100644 --- a/terminal_games/tetris.py +++ b/terminal_games/tetris.py @@ -1,7 +1,7 @@ import time import os import random -from arcade_utils import clear_screen, get_key, draw_retro_box, beep, show_popup, update_stats, load_stats, animated_flash, print_big_title, C_RESET, C_BOLD, C_RED, C_GREEN, C_YELLOW, C_CYAN, C_WHITE, C_MAGENTA, C_BLACK +from arcade_utils import clear_screen, get_key, draw_retro_box, beep, show_popup, update_stats, load_stats, animated_flash, print_big_title, C_RESET, C_BOLD, C_RED, C_GREEN, C_YELLOW, C_CYAN, C_WHITE, C_MAGENTA, C_BLACK, C_BLUE WIDTH = 10 HEIGHT = 20