Git Product home page Git Product logo

words-chains-resolver's Introduction

Words Chains Resolver Game

Construct the shortest sequences that connect two different words changing each time one or more letters. By default the script use an italian dictionary and return all the shortest sequences of words.

Usage

node words-chains-resolver _first_word_ _second_word_ [_number_of_different_letters_]

example :

node words-chains-resolver rana uomo 1

Demo

npm run demo

The demo script will run node words-chains-resolver rana uomo 1.

Output:

Loaded words: 3146
Generating results...
Results:
uomo nomo noma nama nana rana 
uomo nomo nono nano nana rana
uomo nomo noma nona nana rana
uomo nomo nono nona nana rana
uomo pomo poma pama pana rana
uomo domo damo dama rama rana
uomo domo doma dama rama rana
uomo nomo noma nama rama rana
uomo pomo poma pama rama rana
uomo domo damo ramo rama rana
uomo tomo tono tano tana rana
uomo tomo toma tona tana rana
uomo tomo tono tona tana rana

Notes

  • The two words must have the same length.
  • Long words or big dictionaries can use lot of memory. Expand the NodeJS memory limit with the parameter --max-old-space-size=8192 to use 8Gb of RAM or adapt the size based on your availability.
  • To speed up the process is possible to return only the first occurrence of shortest chain, setting the singleResult = true in the first lines of the words-chains-resolver.js script.
  • The dictionary to use can be changed in the first lines of the words-chains-resolver.js script.
  • In case the results contain unexisting words, these can be excluded in the dictionary adding them to the excludeList array in the first lines of the words-chains-resolver.js script.

words-chains-resolver's People

Contributors

damianofalcioni avatar

Watchers

 avatar  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.