This is a basic implementation of the game Wordle, using rust Foreign Function Interface.
The core library contains game mechanics. It can be built as a standard rust library (crate-type: lib
), or as a static library interfaceable in C (crate-type: staticlib
).
Four interfaces have been developped:
- one GUI with GTK4
- one terminal-oriented interface (ansi)
- one for apple iOS
- one for apple macOS
Start | Lost | Won | |
---|---|---|---|
Ansi | |||
Gtk4 Dark | |||
Gtk4 Light | |||
macOS Light | |||
macOS Dark | |||
iOS Dark | |||
iOS Light |
A very simple front with GTK.
Locales were provided for french and german.
It accepts a single command line argument:
wordle-gtk4 [file path]
If a file path is specified, then words will be loaded from this file (it is assumed a single word lies per line). A random word from this list is chosen at each game.
In case no files are provided, the list of words defaults to ["wordle", "wordlerust"]
.
GUI for macOS and iOS was developped using SwiftUI.
As the Gtk4 interface, the macOS application accepts an optional single parameter: a path to a file containing a list of word (one per line).
The iOS application has a tab view as its entrypoint.
The user can edit a list of words, saved under the sandboxed Documents
folder.
Synopsis for the ansi front:
wordle-ansi help
wordle-ansi --help
wordle-ansi -h
wordle-ansi version
wordle-ansi --version
wordle-ansi -v
wordle-ansi [file path]
The ansi front, as the GTK one, takes an optional file path as its unique argument.
The word is picked from the file. If no files are provided, then the words list is loaded from STDIN
.
However words are loaded, user input is read from /dev/tty
.
The output is written in the alternate screen buffer, using the CSI escape sequences described on the ANSI escape code Wikipedia page.
Launch from STDIN |
Launch from file |
---|---|