cordle/README.md
2026-01-27 19:50:10 +00:00

147 lines
3.0 KiB
Markdown

# CORDLE - The C90 Version of Wordle
A C90 implementation of the famous word game Wordle. I originally wrote this
in Python, and decided to rewrite it in C90, to remediate myself, and to have
a project I could work with in my old copy of DOS TurboC. Feel free to do
whatever you like with it.
## Requirements
### Unix/Linux/macOS
- C90 compliant compiler (gcc recommended)
- ncurses library
- GNU Make
### DOS
- DJGPP or Borland C compiler
- PDCurses library
- GNU Make (for DJGPP)
See [DOS_BUILD.md](DOS_BUILD.md) for detailed DOS build instructions.
## Build
### Using Make (Recommended)
```bash
$ make
```
This will:
- Compile all source files with C90 compliance flags
- Create the `cordle` executable in `build/`
- Copy wordlists to `build/wordlists/`
### Alternative: Using build.sh
```bash
$ ./build.sh
Building application.
Compile successful. Copying wordlists...
Build completed.
```
### Other Make Targets
```bash
$ make help # Show all available targets
$ make clean # Remove build artifacts
$ make rebuild # Clean and rebuild from scratch
$ make install # Install system-wide to /usr/local
$ make uninstall # Remove installed files
```
## Install
### System-wide Installation (Unix/Linux/macOS)
```bash
$ sudo make install
```
This installs:
- Binary to `/usr/local/bin/cordle`
- Wordlists to `/usr/local/share/cordle/wordlists/`
The game will automatically find wordlists in:
1. `wordlists/` (relative to current directory)
2. `/usr/local/share/cordle/wordlists/`
3. `$HOME/.local/share/cordle/wordlists/`
4. Custom path via `--wordlist` option
### Manual Installation
Copy the binary and wordlists to your preferred location:
```bash
$ cp build/cordle ~/bin/
$ cp -R wordlists ~/bin/
```
### DOS Installation
* Insure that the TC\BIN, TC\INCLUDE, and TC\LIB directories are in your defined in your DOS environment.
* Insure that the PDCurses library is built, and added to your TC\LIB directory.
1. Build the executable:
```dosbatch
cd cordle\src
tcc -mh -I..\include -ecordle.exe main.c game.c ui.c words.c pdcurses.lib
```
2. Copy the `CORDLE.EXE` executable to C:\CORDLE or D:\CORDLE.
3. Copy the words directory to either C:\CORDLE or D:\CORDLE.
4. Run `CORDLE.EXE` from the CORDLE directory.
## Run
```bash
$ cordle --help
cordle - C90 Wordle Game
Usage: cordle [OPTIONS]
Difficulty Levels:
--easy Common everyday words (default)
--medium Standard vocabulary
--hard Challenging words
Word Categories:
--techy Technical and scientific terms
--literary Literary and archaic terms
--cultural Cultural and international terms
--full Complete dictionary
Custom:
--wordlist FILE Use custom word list
Examples:
cordle --easy
cordle --techy
cordle --wordlist mywords.txt
```
### After Installation
If installed system-wide, run from anywhere:
```bash
$ cordle
$ cordle --medium
$ cordle --hard
```
## Screenshots
**New Game**
![New Game](img/new-game.png)
**Win Game**
![Win Game](img/win-game.png)
**Lose Game**
![Lose Game](img/lose-game.png)