Lexeme - CLI to play a word-guessing game like Wordle

Related tags

CLI Tools lexeme
Overview

What is this?

Python program to play a word-guessing game like Wordle, but…

  • More addictive because you can play it over and over and over, not just once a day.
  • Option for varying the word length (-l, --length) or number of guesses (-g, --guesses)
  • Option to allow guesses that aren't known words (-n, --nonsense)
  • Option to do guess-by-guess analysis, showing how many words you eliminate after each guess (-a, --analysis)
  • Option to show time taken after every guess (-t, --timer)
  • A bunch of unit tests to verify the logic
  • Beautiful command-line text interface ( 😜 )

Running it

Installation

Requires Python 3.x, the colorama module for printing colored letters, and a file containing a list of possible words. The default wordlist is in /usr/share/dict/words, which should exist on any desktop Unix system.

Alternatively, the Collins Scrabble Word Lists seem to work nicely! CSW2019 contains 12,972 five-letter words, for example.

Install with pip3 install https://github.com/dlenski/lexeme/archive/main.zip, then play the game with the command lexeme.

Options

usage: lexeme [-h] [-d DICT] [-g GUESSES] [-l LENGTH] [-n] [-a]

optional arguments:
  -h, --help            show this help message and exit
  -d DICT, --dict DICT  Wordlist to use, either an absolute path or a path
                        relative to /usr/share/dict. Default
                        /usr/share/dict/words.
  -g GUESSES, --guesses GUESSES
                        Maximum number of guesses to allow
  -l LENGTH, --length LENGTH
                        Length of word to guess
  -n, --nonsense        Allow nonsense guesses. (Default is to only allow
                        known words.)
  -a, --analyzer        Analyze remaining possible words, and show their
                        number after each guess. If repeated (cheater mode!),
                        it will show you all the remaining possible words when
                        there are fewer than 100
  -t, --timer           Show time taken after every guess.

Screenshots

Example of gameplay, with analyzer (-a) and timer (`-t) enabled, showing you the number of possible remaining words, and the time taken for each guess:

Example

Example of cheater mode (-aa), show you all of the possible remaining words after each guess, as long as there are ≤100 of them:

Analyzer

Inspiration

You might also like...
A helper program to play wordle

A helper program to play wordle

A Python-based Wordle solver and CLI player

Wordle A Python-based Wordle solver and CLI player This was created using Python 3.9.7. SPOILER ALERT: the data directory contains spoilers for upcomi

A clone of the popular online game Wordle

wordle_clone A CLI application for wordle. Description A clone of the popular online game Wordle.

Cli tool to browse and play anime
Cli tool to browse and play anime

browse and watch anime (scrape from gogoanime) (wip) basically ani-cli but in python cuz python good demo dependencies mpv installation from pypi pip

Sink is a CLI tool that allows users to synchronize their local folders to their Google Drives. It is similar to the Git CLI and allows fast and reliable syncs with the drive.
Sink is a CLI tool that allows users to synchronize their local folders to their Google Drives. It is similar to the Git CLI and allows fast and reliable syncs with the drive.

Sink is a CLI synchronisation tool that enables a user to synchronise local system files and folders with their Google Drives. It follows a git C

flora-dev-cli (fd-cli) is command line interface software to interact with flora blockchain.

Install git clone https://github.com/Flora-Network/fd-cli.git cd fd-cli python3 -m venv venv source venv/bin/activate pip install -e . --extra-index-u

AWS Interactive CLI - Allows you to execute a complex AWS commands by chaining one or more other AWS CLI dependency

AWS Interactive CLI - Allows you to execute a complex AWS commands by chaining one or more other AWS CLI dependency

Python-Stock-Info-CLI: Get stock info through CLI by passing stock ticker.
Python-Stock-Info-CLI: Get stock info through CLI by passing stock ticker.

Python-Stock-Info-CLI Get stock info through CLI by passing stock ticker. Installation Use the following command to install the required modules at on

A simple CLI based any Download Tool, that find files and let you stream or download thorugh WebTorrent CLI or Aria or any command tool
A simple CLI based any Download Tool, that find files and let you stream or download thorugh WebTorrent CLI or Aria or any command tool

Privateer A simple CLI based any Download Tool, that find files and let you stream or download thorugh WebTorrent CLI or Aria or any command tool How

Comments
  • Way waaaaaay faster algorithm… takes seconds instead of minutes/hours

    Way waaaaaay faster algorithm… takes seconds instead of minutes/hours

    I've been thinking about this a lot, and suddenly figured out how to do it while out for a run.

    🏃🏻💭🧠💡👨🏻‍💻🌃…😮⏩💆🏻‍♂️

    I thought we needed O(_N_×_M_²) runtime to figure out the best next guess (O(_N_³) for the first guess). But no! It's possible to figure out the best next guess in O(N_×_M) (O(_N_²) for the first guess).

    The way to do it is… actually amazingly simple and beautiful.

    • See 8128325 for the change to the algorithm.
    • See https://github.com/dlenski/lexeme/commit/154c36f75ab903c9a490e7aff498ed12012333ef for a detailed explanation in the comment.
    opened by dlenski 2
  • python3-unidecode required

    python3-unidecode required

    Tried to run lexeme gave me: AttributeError: 'Namespace' object has no attribute 'strip_diacritics'

    Installing python3-unidecode fixed that. Additional check required, or update in Readme?

    opened by tuxick 1
Owner
Dan Lenski
Physics PhD, marathoner, former Intel semiconductor engineer. I'm a long-time FLOSS user, like to code in Python and C, and enjoy ЯƎƎИI⅁ИƎing.
Dan Lenski
Wordle-textual - Play Wordle from the CLI, using Textual

Wordle, playable from the CLI This project seeks to emulate Wordle in your shell

PhenoM4n4n 3 Mar 29, 2022
Play Wordle Bot - Wordle Bot written in python

Wordle Bot A Bot written in python with a CL Interface to guess adn solve Wordle

Prashant 1 Feb 25, 2022
Wordle-cli - Command-line clone of Josh Wardle's WORDLE

Command-line clone of Josh Wardle's WORDLE, inspired by Paul Battley's Ruby vers

Klipspringer 32 Jan 3, 2023
Wordle breaker: A CLI tool to help you solve Wordle

Wordle Breaker A CLI tool to help you solve Wordle I decided to code a solution

Alex 4 Apr 27, 2022
Wordle-solver - A tool that helps people who struggle with vocabulary to enjoy the famous game of WORDLE

Wordle-Solver Wordle-Solver helps people who struggle with vocabulary to enjoy t

Jason Chao 104 Dec 31, 2022
Play WORDLE game in your terminal.

Wordle TUI Play WORDLE game in your terminal. The game will be kept the same as the Web version. Prerequisites Python 3.7+ Linux/MacOS (Windows is not

Frost Ming 61 Oct 30, 2022
A cli tool , which shows you all the next possible words you can guess from in the game of Wordle.

wordle-helper A cli tool , which shows you all the next possible words you can guess from the Game Wordle. This repo has the code discussed in the You

null 1 Jan 17, 2022
Wordle - Wordle solver with python

wordle what is wordle? https://www.powerlanguage.co.uk/wordle/ preparing $ pip i

shidocchi 0 Jan 24, 2022
Wordle for CLUE - WORDLE clone for Adafruit Clue

Wordle_for_CLUE This project is a clone of the very popular word solving puzzle

Michael Lacock 4 Feb 15, 2022
[WIP]An ani-cli like cli tool for movies and webseries

mov-cli A cli to browse and watch movies. Installation This project is a work in progress. However, you can try it out python git clone https://github

null 166 Dec 30, 2022