Skip to content

dddware/wordl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WORDL

Setup

Install dependencies:

$ npm install

Retrieve dictionary:

$ curl https://raw.githubusercontent.com/charlesreid1/five-letter-words/master/sgb-words.txt --output public/dictionary.txt

Any text file with one word on each line will do, as long all all words are the same length.

Usage

$ npm start     # Run on localhost:3000
$ npm test      # Run unit tests
$ npm run build # Build for production

Bonus: cheating device

Use the getPossibleWords function to see possibilities for a given situation:

import getPossibleWords from "./getPossibleWords";

console.log(getPossibleWords(
  ["s", "a", "l", null, null], // known letters
  ["e", "t", "u"],             // available letters
  ["e"],                       // word contains at least one "e"
  [
    [],
    [],
    [],
    ["t"],                     // fourth letter cannot be "t"
    ["e", "u"]                 // fifth letter cannot be "e" or "u"
  ]
).join("\n"));

// Results:
// salet

About

You know what this is about

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published