GithubHelp home page GithubHelp logo

kamilmielnik / scrabble-solver Goto Github PK

View Code? Open in Web Editor NEW
87.0 5.0 21.0 29.59 MB

Free, open-source, cross-platform, and multi-language analysis tool for Scrabble, Super Scrabble & Literaki. Quickly find top scoring words using given board & tiles. Available in English, French, German, Persian, Polish, Romanian & Spanish.

Home Page: https://scrabble-solver.org

License: Other

JavaScript 4.21% SCSS 8.90% TypeScript 86.89%
scrabble-solver solver scrabble literaki scrabble-word-finder nodejs react redux scrabble-dictionary scrabble-game

scrabble-solver's Introduction

Scrabble Solver logo

Free, open-source, cross-platform, and multi-language analysis tool for Scrabble, Super Scrabble & Literaki

Quickly find top scoring words using given board & tiles

Available at https://scrabble-solver.org in 8 languages

Run it on your machine: npx scrabble-solver@latest

Flag of United Kingdom Flag of United States Flag of France Flag of Germany Flag of Iran Flag of Poland Flag of Romania Flag of Spain

Version License Node version

Build Test ESLint

Screencast GIF showing user interface when solving for oxyphenbutazone, which is a top-scoring word in English version of Scrabble

scrabble-solver

Table of contents

  1. Dictionaries
  2. Run
  3. Uninstall
  4. Develop
    1. Setup
    2. Run app dev server
    3. Rebuild the entire project
    4. Rebuild a single package
    5. Add a new language
  5. Tech stack
  6. Related projects
  7. Media

Dictionaries

Language Word list Word definitions Highest-scoring word
🇬🇧 English 💾 SOWPODS Merriam-Webster oxyphenbutazone (1458)
🇺🇸 English 💾 TWL06 Merriam-Webster oxyphenbutazone (1458)
🇫🇷 French 💾 ODS8 CNRTL schizothymiques (1566)
🇩🇪 German 💾 hippler/german-wordlist DWDS polytoxikomanem (1512)
🇮🇷 Persian 💾 MansourM/persian-to-persian-dictionary واژه یاب ‏(756) اگزیستانسیالیست
🇵🇱 Polish 💾 SJP.PL SJP.PL współposiądźmyż (1512)
🇷🇴 Romanian 💾 LOC 5 dexonline luxemburghezele (1944)
🇪🇸 Spanish 💾 FISE-2 Diccionarios.com flexibilizabais (1323)

Run

You can run Scrabble Solver on your machine - all you need is Node.js 20 or later.

npx scrabble-solver@latest

Give it a while to install and download dictionaries. When it's done it will automatically open http://localhost:3333/ in your browser.

Hit Ctrl + C in your terminal to exit the app and shut down the server.

Uninstall

Dictionaries and logs are stored in $HOME/.scrabble-solver. $HOME location is acquired using os.homedir().

rm -rf $HOME/.scrabble-solver

Develop

These steps are required only if you want to make changes to the source code.

Setup

One-time project setup.

git clone https://github.com/kamilmielnik/scrabble-solver.git
cd scrabble-solver
npm install
npm run build

Run app dev server

The following command will serve the app at http://localhost:3000/.

npm run dev

Note: hot code reload works only for the scrabble-solver package. If you make changes to any other package, you will need to rebuild it (see below).

Rebuild the entire project

npm run build

Rebuild a single package

For convenience, here's a list of commands to rebuild every package individually.

npm run build -w @scrabble-solver/configs
npm run build -w @scrabble-solver/constants
npm run build -w @scrabble-solver/dictionaries
npm run build -w @scrabble-solver/logger
npm run build -w @scrabble-solver/scrabble-solver
npm run build -w @scrabble-solver/solver
npm run build -w @scrabble-solver/types
npm run build -w @scrabble-solver/word-definitions
npm run build -w @scrabble-solver/word-lists

Add a new language

  1. Find and download a flag representing the locale in an SVG format
  2. Rename the file to FlagXX.svg and put it in packages/scrabble-solver/src/icons
  3. Export the SVG file in packages/scrabble-solver/src/icons/index.ts
  4. Add IETF language tag for the new locale in packages/types/src/Locale.ts
  5. Rebuild the types package
    npm run build -w @scrabble-solver/types
  6. Add locale configuration in packages/scrabble-solver/src/i18n/constants.ts
  7. Update locale-detecting code in packages/scrabble-solver/src/lib/detectLocale.ts
  8. Add game configs for the new locale in packages/configs/src/languages
  9. Add an export for these locale configs in packages/configs/src/languages/index.ts
  10. Add a translation file in packages/scrabble-solver/src/i18n/languages and fill it with translations
    • Copy any existing file, e.g. english.json and modify it
  11. Add an entry for the translations in packages/scrabble-solver/src/i18n/i18n.ts
  12. Add a function to fetch the list of words in the new locale in packages/word-lists/src/getWordList.ts
  13. Add a function to fetch the word definition in the new locale in packages/word-definitions/src/crawl.ts
  14. Add a function to parse the word definition crawled in the previous step in packages/word-definitions/src/parse.ts

Tech stack

Related projects

Lexatious

The user interface and source code for the web front end of Lexatious is based on Scrabble Solver.

Media

scrabble-solver's People

Contributors

cboki avatar hansolo80 avatar kamilmielnik avatar kyczan avatar mansourm avatar rerollea avatar theraphael0000 avatar yuriyyakym avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

scrabble-solver's Issues

Library usage

Hello, can I use this package as a library that helps me solving scrabbles just by giving it input characters?

What I want to build is something like this: http://www.scrabble-solver.com/

The idea is to use it the following way:

const scrabbleSolver = require('scrabble-solver');
const input = ['A', 'B', 'S', 'C', 'U', 'V', 'W', 'I', 'J'];
const language = 'en';
const results = scrabbleSolver(input, language); // ["AB", "ABS", "AS", "BA", "BAC", "BACS", "BAS", "BUS", "CAB", "CABS", "CUB", "CUBS", "SAB", "SAC", "SAU", "SAV", "SCAB", "SCUBA", "SCUBA", "SUB", "SUBA", "US", "UVA", "UVAS", "VAC", "VACS", "VAS", "VAU", "VAUS"]

"Q" tile does not work

Steps to reproduce

  1. Pick en-US
  2. put "Q" as a tile
  3. search

Result

  1. "Q" in not being sent in the HTTP GET request

Organize buttons

  • group info buttons (keymap, github) and action buttons (settings, clear) together
  • add separator between the groups

Run solver on client side

  • ability to download a dictionary and keep it in browser storage
  • [service worker] to intercept requests and use AJAX requests only when dictionary has not downloaded yet
  • initialize downloading dictionary when locale is selected
  • make solver return a cancellable promise
  • make service worker cancel all pending requests when starting a new one (per pathname)

Config editor

Custom configs editable via UI.

Requires refactoring configId parameter of solve endpoint into config.

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.