Skip to content

fluctuation-issue/rust-ffi-wordle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-ffi-wordle

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

Screenshots: interfaces comparisons

Start Lost Won
Ansi Ansi Start Ansi Lost Ansi Won
Gtk4 Dark Gtk4 Dark Start Gtk4 Dark Lost Gtk4 Dark Won
Gtk4 Light Gtk4 Light Start Gtk4 Light Lost Gtk4 Light Won
macOS Light macOS Light Start macOS Light Lost macOS Light Won
macOS Dark macOS Dark Start macOS Dark Lost macOS Dark Won
iOS Dark iOS Dark Start iOS Dark Lost iOS Dark Won
iOS Light iOS Light Start iOS Light Lost iOS Light Won

GUI with GTK4

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 apple plateforms

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.

Ansi front

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
Ansi Launch from STDIN Ansi Launch from File

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published