Code Monkey home page Code Monkey logo

astrid's Introduction

About

Astrid is a solver for the currently popular Facebook Messenger game "WordBlitz". Astrid generates solutions for WordBlitz provided with sixteen letters that match the same arrangement of the WordBlitz puzzle.

Possible words are generated by using each letter as a starting point and then traversing the grid of letters by moving to the next adjacent letter. After each move, the total letters traversed thus far are checked against an English lexis in order to determine if the current collection of letters makes a valid word or not.

Building

Simply type go build in the root directory of the project. This will create a binary called astrid.

Executing

After building, type ./astrid to execute the solver. You will be presented with a prompt where you must type sixteen letters that represent the WordBlitz puzzle. Type the letters as the appear in WordBlitz row by row from top to bottom. After typing press enter.

Astrid should output 16 columns of text with each column headed by the rank of the letter as it appeared in the original puzzle. Each column consists of the possible words that can be formed starting from that letter.

If the letter grid is like the image below; the input would be "abcdefghijklmnop"

Letter Grid

Commands

If the word test is typed the letters used will be the first 16 letters of the English alphabet.

Configuring

At startup Astrid loads a configuration file (config.conf) which contains some options that can be modified. A description of the options along with their default values are in the table below.

Option Description Default
maxWordLength Most letters a word should have 9
minWordLength Least letters a word should have 3
maxWordsPerRow Number of words shown before repeating column header 15
wordColumnsPerRow Number of columns of words to show per row 16
sortDescending Sort words in descending order True
enableHighlighting Highlight word columns and words with rare letters True
highlightLetters Words containing these letters are highlighted. xqzjy
lexisFilePath Path to file with list of words lexis

The default options should be fine on most systems. If your display is small and/or does not support coloured text, adjust values of maxWordsPerRow, wordColumnsPerRow and enableHighlighting respectively.

Miscellaneous

The data structure used to store the lexis is a Trie. While this is a fairly efficient data structure for the words, a more space-efficient structure such as a radix trie can be used. Such an implementation change should be trivial since the code is quite loosely coupled. So feel free to make this change yourself if necessary. Otherwise I'll get to it sometime later when I have more time :-).

Finally, Astrid is not perfect because the list of what constitutes valid words for a language is subjective and always-changing. Because of this, not all solution words output by Astrid will be found in a WordBlitz puzzle. If you have a more correct lexis you can point Astrid to it using the lexisFilePath configuration option.

Last Modified Tue 19 Feb 10:05:35 GMT 2019

astrid's People

Contributors

maxbaird avatar verrol avatar

Watchers

 avatar  avatar

Forkers

verrol

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.