minor tweaks

This commit is contained in:
Gregory Gauthier 2025-10-01 10:24:47 +01:00
parent abde27f590
commit ec5c2eae75
3 changed files with 15 additions and 6 deletions

View File

@ -15,7 +15,7 @@ A terminal-based implementation of Wordle using Python and ncurses.
## How to Run
```bash
$ poetry run python pyrdle.py --help (20361d14h4m)|*[main]
$ poetry run python pyrdle.py --help
usage: pyrdle.py [-h] [--easy | --medium | --hard] [--common | --literary | --techy | --cultural | --full ]
[--wordlist FILE]

View File

@ -13,7 +13,7 @@ from typing import List, Tuple
WORDLIST_DIR = "wordlists"
class pyrdleGame:
class Pyrdle:
def __init__(self):
self.word_list = []
self.target_word = ""
@ -132,7 +132,7 @@ def draw_title(stdscr, y_offset: int, difficulty: str = ""):
stdscr.addstr(y_offset, x, title)
stdscr.attroff(curses.A_BOLD)
def draw_board(stdscr, game: pyrdleGame, y_offset: int):
def draw_board(stdscr, game: Pyrdle, y_offset: int):
"""Draw the game board with all guesses"""
height, width = stdscr.getmaxyx()
board_x = (width - (game.word_length * 4 - 1)) // 2
@ -165,7 +165,7 @@ def draw_board(stdscr, game: pyrdleGame, y_offset: int):
x = board_x + col * 4
stdscr.addstr(y, x, "[ ]")
def draw_keyboard(stdscr, game: pyrdleGame, y_offset: int):
def draw_keyboard(stdscr, game: Pyrdle, y_offset: int):
"""Draw visual keyboard showing letter status"""
height, width = stdscr.getmaxyx()
@ -318,7 +318,7 @@ def main(stdscr):
curses.init_pair(6, curses.COLOR_WHITE, curses.COLOR_BLACK) # Unused letters (gray/dim)
# Initialize game
game = pyrdleGame()
game = Pyrdle()
if not game.load_words(word_file):
# Try fallback to default word list
if word_file != "pyrdle_words.txt" and game.load_words("pyrdle_words.txt"):
@ -374,7 +374,7 @@ def main(stdscr):
key = stdscr.getch()
if key in [ord('n'), ord('N')]:
# Start new game
game = pyrdleGame()
game = Pyrdle()
game.load_words(word_file)
message = ""
continue

View File

@ -180,6 +180,7 @@ BINGO
BIOME
BIPED
BIRCH
BIRDY
BIRTH
BISON
BITER
@ -1911,6 +1912,7 @@ JOINT
JOLLY
JUDGE
JUICE
KARMA
KNIFE
KNOCK
LABEL
@ -1949,6 +1951,7 @@ LUNCH
LUMPY
LUNGS
LUNKY
LUPIS
LUSTY
LYING
MAGIC
@ -1999,6 +2002,7 @@ MOVED
MOVIE
MUDDY
MUSIC
NADIR
NAIVE
NAKED
NAMED
@ -2040,6 +2044,7 @@ OWNER
OXIDE
PAGAN
PAINT
PANDA
PANEL
PANIC
PAPER
@ -2108,6 +2113,8 @@ PUPIL
PUPPY
PURSE
QUAKE
QUARK
QUART
QUEEN
QUERY
QUEST
@ -2118,6 +2125,8 @@ QUILT
QUITE
QUOTA
QUOTE
RABID
RACER
RADAR
RADIO
RAINY