Giter Site home page Giter Site logo

bogsolve's Introduction

bogsolve

What?

A program which takes a Boggle grid and a list of acceptable words, and determines which words can be formed using the grid.

Why?

Learning Haskell and stuff.

How?

You'll need:

Compile it by getting the source and running (from the source root):

cd src
ghc --make Main -o bogsolve

Then run it using the following:

bogsolve pathToDictionary gridWidth boggleGrid

E.g.

bogsolve ../web2 4 e g i b h o t n r s e r y p e qu

You must specify at least one grid letter. The above command outputs the following (given a dictionary containing all the relevant words):

...
e  g  i  b      pry                             
h  o  t  n      1 point(s)                      
R  s  e  r      p (1, 3) -> r (0, 2) -> y (0, 3)
Y  P  e  qu                                     

e  g  i  b      pryse                                                   
h  o  t  n      2 point(s)                                              
R  S  E  r      p (1, 3) -> r (0, 2) -> y (0, 3) -> s (1, 2) -> e (2, 2)
Y  P  e  qu                                                             

e  g  i  b      pryse                                                   
h  o  t  n      2 point(s)                                              
R  S  e  r      p (1, 3) -> r (0, 2) -> y (0, 3) -> s (1, 2) -> e (2, 3)
Y  P  E  qu                                                             

e  g  i  b      pst                             
h  o  T  n      1 point(s)                      
r  S  e  r      p (1, 3) -> s (1, 2) -> t (2, 1)
y  P  e  qu                                     

e  g  i  b      pyr                             
h  o  t  n      1 point(s)                      
R  s  e  r      p (1, 3) -> y (0, 3) -> r (0, 2)
Y  P  e  qu                                     

e  g  i  b      pyro                                        
h  O  t  n      1 point(s)                                  
R  s  e  r      p (1, 3) -> y (0, 3) -> r (0, 2) -> o (1, 1)
Y  P  e  qu                                                 

e  g  i  b      queen                                        
h  o  t  N      2 point(s)                                   
r  s  E  r      qu (3, 3) -> e (2, 3) -> e (2, 2) -> n (3, 1)
y  p  E  QU                                                  
...
Available points: 379

Note that words may be duplicated if there's more than one way to make them (as with 'pryse' above). The available points are calculated without duplicates (you can only score a word once, no matter how many ways you can make it).

bogsolve's People

Contributors

shyalex avatar

Stargazers

 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.