Coder Social home page Coder Social logo

random-tools's Introduction

random-tools

Random tools/scripts I make for myself

This is a script I use to help me figure out what words are possible given what I already know from previous guesses. It depends on nltk.corpus's words package, which requires you to:

  1. Install nltk
  2. Run the following in python: nltk.download('words')

It accepts a 3-line input.txt containing the following:

  • Line 1: Known letters in known places (aka "green" letters)
  • Line 2: Known letters in unknown places (aka "yellow" letters)
  • Line 3: Known absent letters (aka "black" or "grey" letters)

The first two lines include zero-based indices for the respective letters, and any of the three lines can be empty. For example:

Guess Letter (color) Letter (color) Letter (color) Letter (color) Letter (color)
1 A (black/grey) U (black/grey) D (black/grey) I (green) O (black/grey)
2 S (black/grey) T (black/grey) R (black/grey) I (green) P (yellow)

The contents of input.txt would be as follows:

i3
p4
audostr

Which would result in this output:

pinic
pilin
pixie
pylic
pyxie
pekin
lipin

These are all of the 5-letter words that meet the constraints of what we already know about the word. In this case, the word ended up being pixie, which was the 3rd word in our output.

random-tools's People

Contributors

mlcarey321 avatar

Watchers

 avatar

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.