Coder Social home page Coder Social logo

sanamahti's Introduction

Sanamahti

Sanamahti is a program that plays the popular Sanajahti game (the game is called Wordz in English). It finds and returns all possible words from the given 4x4 grid that appear on its wordlist.

Wordlist

The finnish wordlist provided, is a derivative work (words that contains symobols are removed) of the Nykysuomen sanalista licensed under the CC BY 4.0 license. The original wordlist is available for download here

License

All the files apart from the wordlist are licensed under the MIT license. For more information see the LICENSE-file

Implementation

/src/main.rs contains an example usage of the interface provided by /src/lib.rs.

/src/lib.rs implements a LetterTree datatype that is constructed on runtime from the wordlist. Each node in the tree represents a letter that is a part of one or more words. If the node is the last letter of a word, then it's field is_word is set to true.

Additionally a solve-function is implemented. The solve function performs a BFS starting from each tile on the grid and returns all the words found. The LetterTree datatype allows the BFS to be terminated early for a branch that cannot produce a valid word.

Demo

Ideas for further development

  • Allow grids of artificial size
  • Implementation for languages other than Finnish.

sanamahti's People

Contributors

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