Coder Social home page Coder Social logo

curdle's Introduction

curdle

Wordle in curses. I made this primarily for self-education purposes to get reacquainted with programming. Most other command-line Wordle clones are also either really simple or incapable of running on small windows. This tries to strike a balance between features and maximum usability in a typical cli enviroment (without requiring external libraries).

Installation

Requires Python 3.6 or higher.

An terminal which supports truecolor and modifying color values on the fly is recommended.

Should not require any additional tools on *nix systems (MacOS, Linux), simply clone this repository:

git clone https://github.com/avalonv/curdle
cd curdle

Usage

By default, running ./curdle.py will pick a word at random.

You can also play against the word of the day from the NYT version like so:

./curdle.py --daily

see the proverbial --help summary for other options:

options:
  --custom word  specify word to play against
  --size num     maximum width of the window
  --tries num    max number of guesses
  --secret       don't show solution if player loses
  --strict       use smaller wordlist for allowed guesses
  --simplecolor  fallback palette for terminals such as Konsole

Wordlists

Words to play against, and words which can be used as guesses are stored as separate lists (with the latter being significantly larger) by default. Both are available in modules/.

The provided valid-solutions list tries to track the NYT version of Wordle, while the valid-guesses list includes virtually every 5 letter word in English.

Their contents can be made identical with cat valid-solutions.txt > valid-guesses.txt if preferred for whatever reason, although --strict achieves the same thing non-destructively.

If creating a custom wordlist, valid-guesses should be equal or greater than valid-solutions. Doing it the other way around will break things.

  • In theory, its logic should already support words of any length, as long as the appropriate lists are provided. In practice there's a good chance the interface will be completely fucked up.

Windows

The built-in python curses module isn't supported on Windows :(

Alternatives such as Uni-Curses seem unreliable, but I'd be willing to try a similar alternative if it exists.

TODO:

  • Allow passing of arguments for what the word should be

  • Maybe add nyt option which syncs with the official game's word of the day

  • Update word display logic to more closely match the original's when there are repeated letters

  • Expose more options as command line arguments

  • Fix terrible colour contrast on some terminals

  • Hard mode

curdle's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

curdle's Issues

Extra letters shouldn't count as yellow if they have been identified as green

In the original game, whenever a player's guess correctly identifies a letter's location, extraneous instances of that letter for that guess are greyed-out, instead of being printed as yellow.
image
image
This is a seemingly small but fundamental mechanic as it lets the player know not to repeat the same letter unnecessarily, without it guessing the word becomes considerably harder depending on what combinations are used.

The thing to consider is whether to bake this in the word comparison algorithm, or only in how the word is displayed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.