From 94de0130bc64fb7fe20baab2182ebecd49e3797f Mon Sep 17 00:00:00 2001 From: Gregory Gauthier Date: Wed, 17 Dec 2025 09:59:33 +0000 Subject: [PATCH] rename word files --- src/main.c | 20 +++++++++---------- src/ui.c | 3 +-- src/words.c | 4 ++-- .../{pyrdle_words.txt => cordle_words.txt} | 0 ...cultural.txt => cordle_words_cultural.txt} | 0 ...e_words_easy.txt => cordle_words_easy.txt} | 0 ...e_words_full.txt => cordle_words_full.txt} | 0 ...e_words_hard.txt => cordle_words_hard.txt} | 0 ...literary.txt => cordle_words_literary.txt} | 0 ...rds_medium.txt => cordle_words_medium.txt} | 0 ...words_techy.txt => cordle_words_techy.txt} | 0 11 files changed, 13 insertions(+), 14 deletions(-) rename wordlists/{pyrdle_words.txt => cordle_words.txt} (100%) rename wordlists/{pyrdle_words_cultural.txt => cordle_words_cultural.txt} (100%) rename wordlists/{pyrdle_words_easy.txt => cordle_words_easy.txt} (100%) rename wordlists/{pyrdle_words_full.txt => cordle_words_full.txt} (100%) rename wordlists/{wordle_words_hard.txt => cordle_words_hard.txt} (100%) rename wordlists/{pyrdle_words_literary.txt => cordle_words_literary.txt} (100%) rename wordlists/{pyrdle_words_medium.txt => cordle_words_medium.txt} (100%) rename wordlists/{pyrdle_words_techy.txt => cordle_words_techy.txt} (100%) diff --git a/src/main.c b/src/main.c index 0d0cb84..4fbeffa 100644 --- a/src/main.c +++ b/src/main.c @@ -19,30 +19,30 @@ void parse_arguments(int argc, char *argv[], char *filename, char *difficulty) { int i; /* Default values */ - strcpy(filename, "pyrdle_words_easy.txt"); + strcpy(filename, "cordle_words_easy.txt"); strcpy(difficulty, "EASY"); for (i = 1; i < argc; i++) { if (strcmp(argv[i], "--easy") == 0) { - strcpy(filename, "pyrdle_words_easy.txt"); + strcpy(filename, "cordle_words_easy.txt"); strcpy(difficulty, "EASY"); } else if (strcmp(argv[i], "--medium") == 0) { - strcpy(filename, "pyrdle_words_medium.txt"); + strcpy(filename, "cordle_words_medium.txt"); strcpy(difficulty, "MEDIUM"); } else if (strcmp(argv[i], "--hard") == 0) { strcpy(filename, "pyrdle_words_hard.txt"); strcpy(difficulty, "HARD"); } else if (strcmp(argv[i], "--techy") == 0) { - strcpy(filename, "pyrdle_words_techy.txt"); + strcpy(filename, "cordle_words_techy.txt"); strcpy(difficulty, "TECHNICAL"); } else if (strcmp(argv[i], "--literary") == 0) { - strcpy(filename, "pyrdle_words_literary.txt"); + strcpy(filename, "cordle_words_literary.txt"); strcpy(difficulty, "LITERARY"); } else if (strcmp(argv[i], "--cultural") == 0) { - strcpy(filename, "pyrdle_words_cultural.txt"); + strcpy(filename, "cordle_words_cultural.txt"); strcpy(difficulty, "CULTURAL"); } else if (strcmp(argv[i], "--full") == 0) { - strcpy(filename, "pyrdle_words_full.txt"); + strcpy(filename, "cordle_words_full.txt"); strcpy(difficulty, "FULL"); } else if (strcmp(argv[i], "--wordlist") == 0 && i + 1 < argc) { strcpy(filename, argv[i + 1]); @@ -53,7 +53,7 @@ void parse_arguments(int argc, char *argv[], char *filename, char *difficulty) { } /* Main game loop */ -int main_game_loop(int argc, char *argv[]) { +int main_game_loop(const int argc, char *argv[]) { WINDOW *stdscr; GameState game; char filename[MAX_FILENAME]; @@ -87,8 +87,8 @@ int main_game_loop(int argc, char *argv[]) { if (!load_words(&game, filename)) { /* Try fallback */ - if (strcmp(filename, "pyrdle_words.txt") != 0 && - load_words(&game, "pyrdle_words.txt")) { + if (strcmp(filename, "cordle_words.txt") != 0 && + load_words(&game, "cordle_words.txt")) { strcpy(difficulty, "DEFAULT"); } else { mvaddstr(0, 0, "Error: Could not load word list"); diff --git a/src/ui.c b/src/ui.c index 27d6cd3..cd62e82 100644 --- a/src/ui.c +++ b/src/ui.c @@ -4,7 +4,6 @@ /* ui.c - User interface implementation */ #include "../include/ui.h" #include -#include /* Keyboard layout */ static const char *keyboard_rows[3] = { @@ -123,7 +122,7 @@ void draw_keyboard(WINDOW *win, GameState *game, int y) { } /* Draw centered message */ -void draw_message(WINDOW *win, const char *message, int y, int color_pair) { +void draw_message(WINDOW *win, const char *message, const int y, const int color_pair) { int height, width, x; getmaxyx(win, height, width); diff --git a/src/words.c b/src/words.c index 7de603b..2276a43 100644 --- a/src/words.c +++ b/src/words.c @@ -59,14 +59,14 @@ int load_words(GameState *game, const char *filename) { return 0; } - /* Select random target word */ + /* Select a random target word */ srand((unsigned int) time(NULL)); strcpy(game->target_word, game->words[rand() % game->word_count]); return 1; } -/* Check if word exists in word list */ +/* Check if word exists in a word list */ int is_valid_word(GameState *game, const char *word) { int i; char upper_word[WORD_LENGTH + 1]; diff --git a/wordlists/pyrdle_words.txt b/wordlists/cordle_words.txt similarity index 100% rename from wordlists/pyrdle_words.txt rename to wordlists/cordle_words.txt diff --git a/wordlists/pyrdle_words_cultural.txt b/wordlists/cordle_words_cultural.txt similarity index 100% rename from wordlists/pyrdle_words_cultural.txt rename to wordlists/cordle_words_cultural.txt diff --git a/wordlists/pyrdle_words_easy.txt b/wordlists/cordle_words_easy.txt similarity index 100% rename from wordlists/pyrdle_words_easy.txt rename to wordlists/cordle_words_easy.txt diff --git a/wordlists/pyrdle_words_full.txt b/wordlists/cordle_words_full.txt similarity index 100% rename from wordlists/pyrdle_words_full.txt rename to wordlists/cordle_words_full.txt diff --git a/wordlists/wordle_words_hard.txt b/wordlists/cordle_words_hard.txt similarity index 100% rename from wordlists/wordle_words_hard.txt rename to wordlists/cordle_words_hard.txt diff --git a/wordlists/pyrdle_words_literary.txt b/wordlists/cordle_words_literary.txt similarity index 100% rename from wordlists/pyrdle_words_literary.txt rename to wordlists/cordle_words_literary.txt diff --git a/wordlists/pyrdle_words_medium.txt b/wordlists/cordle_words_medium.txt similarity index 100% rename from wordlists/pyrdle_words_medium.txt rename to wordlists/cordle_words_medium.txt diff --git a/wordlists/pyrdle_words_techy.txt b/wordlists/cordle_words_techy.txt similarity index 100% rename from wordlists/pyrdle_words_techy.txt rename to wordlists/cordle_words_techy.txt