scrabble-solver 2.18.10-alpha.2 → 2.19.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -0
- package/{packages/scrabble-solver/.next → .next}/build-manifest.json +16 -16
- package/{packages/scrabble-solver/.next → .next}/prerender-manifest.json +4 -4
- package/{packages/scrabble-solver/.next → .next}/react-loadable-manifest.json +27 -21
- package/{packages/scrabble-solver/.next → .next}/routes-manifest.json +7 -17
- package/.next/server/chunks/309.js +1 -0
- package/.next/server/chunks/344.js +1 -0
- package/.next/server/chunks/371.js +1 -0
- package/.next/server/chunks/465.js +1 -0
- package/.next/server/chunks/612.js +5 -0
- package/.next/server/chunks/623.js +1 -0
- package/.next/server/chunks/641.js +1 -0
- package/.next/server/chunks/67.js +1 -0
- package/{packages/scrabble-solver/.next → .next}/server/chunks/692.js +1 -1
- package/.next/server/chunks/705.js +1 -0
- package/.next/server/chunks/712.js +1 -0
- package/.next/server/chunks/715.js +1 -0
- package/.next/server/chunks/812.js +1 -0
- package/.next/server/chunks/846.js +1 -0
- package/.next/server/chunks/886.js +1 -0
- package/.next/server/chunks/923.js +1 -0
- package/.next/server/chunks/942.js +1 -0
- package/.next/server/chunks/953.js +1 -0
- package/.next/server/chunks/961.js +1 -0
- package/.next/server/chunks/97.js +1 -0
- package/.next/server/middleware-build-manifest.js +1 -0
- package/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/{packages/scrabble-solver/.next/server/pages/not-found.html → .next/server/pages/404.html} +2 -2
- package/.next/server/pages/404.js +28 -0
- package/{packages/scrabble-solver/.next → .next}/server/pages/500.html +2 -2
- package/.next/server/pages/_document.js +28 -0
- package/.next/server/pages/api/dictionary/[locale]/[word].js +2 -0
- package/{packages/scrabble-solver/.next → .next}/server/pages/api/dictionary/[locale].js +1 -1
- package/.next/server/pages/api/solve.js +1 -0
- package/.next/server/pages/api/verify.js +1 -0
- package/.next/server/pages/index.html +29 -0
- package/.next/server/pages/index.js +30 -0
- package/.next/server/pages/index.json +1 -0
- package/{packages/scrabble-solver/.next → .next}/server/pages-manifest.json +3 -4
- package/.next/server/preview-props.json +5 -0
- package/.next/server/route-cache/PAGES/8a5edab282632443219e051e4ade2d1d5bbc671c781051bf1437897cbdfea0f1/$/index.html +29 -0
- package/.next/server/route-cache/PAGES/8a5edab282632443219e051e4ade2d1d5bbc671c781051bf1437897cbdfea0f1/$/index.json +1 -0
- package/{packages/scrabble-solver/.next → .next}/server/route-cache/PAGES/8a5edab282632443219e051e4ade2d1d5bbc671c781051bf1437897cbdfea0f1/$/index.meta +1 -1
- package/.next/server/webpack-api-runtime.js +1 -0
- package/.next/static/Ng_NN9gQywZowmg2O0pgm/_buildManifest.js +1 -0
- package/.next/static/chunks/100.52dda92e5e8a952a.js +1 -0
- package/{packages/scrabble-solver/.next/server/chunks/953.js → .next/static/chunks/307.8fdeb1732d749981.js} +1 -1
- package/.next/static/chunks/363.25b64181ebca205d.js +1 -0
- package/.next/static/chunks/422.8327da4bbddd0842.js +1 -0
- package/.next/static/chunks/519.9f9c2d29933bf2ef.js +1 -0
- package/{packages/scrabble-solver/.next/static/chunks/541.dcd9e8b804f88da5.js → .next/static/chunks/541.c69629e483176ad7.js} +1 -1
- package/.next/static/chunks/628.3175e816bc17d5c7.js +1 -0
- package/{packages/scrabble-solver/.next/static/chunks/631.98d42abad0a60af6.js → .next/static/chunks/631.3623a2830ab30d1e.js} +1 -1
- package/.next/static/chunks/663.cfbde775630d10fd.js +1 -0
- package/.next/static/chunks/693.55a42abad20cbdaa.js +1 -0
- package/.next/static/chunks/73.73bfdde6a7a9b42b.js +1 -0
- package/{packages/scrabble-solver/.next/static/chunks/744-5ad846426b8f4514.js → .next/static/chunks/744-5baf05ff91b58ebe.js} +2 -2
- package/.next/static/chunks/820.e8f3e1c85e1657ec.js +1 -0
- package/.next/static/chunks/865.5265cef552d53595.js +1 -0
- package/.next/static/chunks/912.b802c1066a130cf6.js +1 -0
- package/.next/static/chunks/939.63d71e74e359a311.js +1 -0
- package/.next/static/chunks/pages/404-8013c66eb40999e8.js +1 -0
- package/.next/static/chunks/pages/_app-aee589671f9cc846.js +1 -0
- package/.next/static/chunks/pages/index-a96995844e778716.js +1 -0
- package/.next/static/chunks/webpack-4bca6879a7d98e24.js +1 -0
- package/.next/static/css/90e8d51d917ed7e3.css +1 -0
- package/README.md +5 -217
- package/bin/scrabble-solver.js +35 -4
- package/{packages/scrabble-solver/next.config.js → next.config.js} +3 -3
- package/package.json +92 -52
- package/{packages/scrabble-solver/public → public}/llms.txt +1 -1
- package/{packages/scrabble-solver/public → public}/service-worker.js +1 -1
- package/.gitattributes +0 -2
- package/.next/trace +0 -1
- package/.next/trace-build +0 -1
- package/.oxfmtrc.json +0 -17
- package/.oxlintrc.json +0 -314
- package/CLAUDE.md +0 -134
- package/HISTORY.md +0 -13
- package/bun-test-globals.d.ts +0 -1
- package/bun.lock +0 -2150
- package/bun.test.preload.ts +0 -21
- package/bunfig.toml +0 -9
- package/e2e/app.spec.ts +0 -124
- package/e2e/bugs/112-character-bonus.spec.ts +0 -25
- package/e2e/bugs/129-esc-sidebar.spec.ts +0 -17
- package/e2e/bugs/2-q-tile-in-english.spec.ts +0 -19
- package/e2e/bugs/3-x-tile-in-polish.spec.ts +0 -19
- package/e2e/bugs/30-click-inside-radio-icon.spec.ts +0 -25
- package/e2e/bugs/333-disabled-radio-cursor.spec.ts +0 -18
- package/e2e/bugs/342-results-sorting.spec.ts +0 -30
- package/e2e/bugs/352-dictionary-race-condition.spec.ts +0 -27
- package/e2e/bugs/363-dictionary-input-unique-words.spec.ts +0 -27
- package/e2e/bugs/380-transliteration-when-pasting.spec.ts +0 -55
- package/e2e/bugs/398-digraphs-in-created-words.spec.ts +0 -23
- package/e2e/bugs/401-board-state-on-game-change.spec.ts +0 -24
- package/e2e/bugs/445-tile-text-selection.spec.ts +0 -38
- package/e2e/bugs/451-results-list-gap-hover.spec.ts +0 -35
- package/e2e/bugs/452-stale-translations-cache.spec.ts +0 -32
- package/e2e/bugs/461-regexp-highlight.spec.ts +0 -33
- package/e2e/features/198-highlight-unreachable-cells.spec.ts +0 -84
- package/e2e/features/427-highlight-created-words.spec.ts +0 -86
- package/e2e/features/430-highlight-unreachable-cells-results.spec.ts +0 -74
- package/e2e/features/91-hover-remaining-tile-highlights.spec.ts +0 -97
- package/e2e/features/hidden-coordinates-migration.spec.ts +0 -27
- package/e2e/features/result-candidate-picker.spec.ts +0 -21
- package/e2e/features/results-interactions.spec.ts +0 -170
- package/e2e/features/solver-paths.spec.ts +0 -45
- package/e2e/features/words-dictionary-search.spec.ts +0 -36
- package/e2e/features/words-empty-state.spec.ts +0 -42
- package/e2e/features/words-interactions.spec.ts +0 -179
- package/e2e/features/words-preview.spec.ts +0 -140
- package/e2e/features/words-table-filtering.spec.ts +0 -22
- package/e2e/features/words-table-sorting.spec.ts +0 -33
- package/e2e/lib/actions.ts +0 -202
- package/e2e/lib/index.ts +0 -2
- package/e2e/lib/selectors.ts +0 -108
- package/e2e/tsconfig.json +0 -10
- package/nx.json +0 -39
- package/packages/configs/README.md +0 -3
- package/packages/configs/build/games/crossplay.d.ts +0 -19
- package/packages/configs/build/games/crossplay.js +0 -73
- package/packages/configs/build/games/index.d.ts +0 -9
- package/packages/configs/build/games/index.js +0 -25
- package/packages/configs/build/games/kelimelik.d.ts +0 -19
- package/packages/configs/build/games/kelimelik.js +0 -65
- package/packages/configs/build/games/letterLeague.d.ts +0 -19
- package/packages/configs/build/games/letterLeague.js +0 -161
- package/packages/configs/build/games/literaki.d.ts +0 -26
- package/packages/configs/build/games/literaki.js +0 -110
- package/packages/configs/build/games/scrabble.d.ts +0 -19
- package/packages/configs/build/games/scrabble.js +0 -78
- package/packages/configs/build/games/scrabbleDuel.d.ts +0 -19
- package/packages/configs/build/games/scrabbleDuel.js +0 -50
- package/packages/configs/build/games/superScrabble.d.ts +0 -19
- package/packages/configs/build/games/superScrabble.js +0 -141
- package/packages/configs/build/games/wordfeud.d.ts +0 -19
- package/packages/configs/build/games/wordfeud.js +0 -81
- package/packages/configs/build/games/wyrazy.d.ts +0 -19
- package/packages/configs/build/games/wyrazy.js +0 -73
- package/packages/configs/build/getConfig.d.ts +0 -2
- package/packages/configs/build/getConfig.js +0 -46
- package/packages/configs/build/hasConfig.d.ts +0 -2
- package/packages/configs/build/hasConfig.js +0 -42
- package/packages/configs/build/index.d.ts +0 -5
- package/packages/configs/build/index.js +0 -44
- package/packages/configs/build/languages/english.d.ts +0 -15
- package/packages/configs/build/languages/english.js +0 -456
- package/packages/configs/build/languages/french.d.ts +0 -2
- package/packages/configs/build/languages/french.js +0 -37
- package/packages/configs/build/languages/german.d.ts +0 -2
- package/packages/configs/build/languages/german.js +0 -40
- package/packages/configs/build/languages/index.d.ts +0 -8
- package/packages/configs/build/languages/index.js +0 -24
- package/packages/configs/build/languages/persian.d.ts +0 -2
- package/packages/configs/build/languages/persian.js +0 -43
- package/packages/configs/build/languages/polish.d.ts +0 -4
- package/packages/configs/build/languages/polish.js +0 -119
- package/packages/configs/build/languages/romanian.d.ts +0 -3
- package/packages/configs/build/languages/romanian.js +0 -64
- package/packages/configs/build/languages/spanish.d.ts +0 -2
- package/packages/configs/build/languages/spanish.js +0 -39
- package/packages/configs/build/languages/turkish.d.ts +0 -3
- package/packages/configs/build/languages/turkish.js +0 -75
- package/packages/configs/package.json +0 -41
- package/packages/configs/src/games/crossplay.ts +0 -87
- package/packages/configs/src/games/index.ts +0 -9
- package/packages/configs/src/games/kelimelik.ts +0 -63
- package/packages/configs/src/games/letterLeague.ts +0 -177
- package/packages/configs/src/games/literaki.ts +0 -108
- package/packages/configs/src/games/scrabble.ts +0 -76
- package/packages/configs/src/games/scrabbleDuel.ts +0 -56
- package/packages/configs/src/games/superScrabble.ts +0 -139
- package/packages/configs/src/games/wordfeud.ts +0 -79
- package/packages/configs/src/games/wyrazy.ts +0 -71
- package/packages/configs/src/getConfig.ts +0 -14
- package/packages/configs/src/hasConfig.ts +0 -8
- package/packages/configs/src/index.ts +0 -6
- package/packages/configs/src/languages/english.ts +0 -469
- package/packages/configs/src/languages/french.ts +0 -36
- package/packages/configs/src/languages/german.ts +0 -39
- package/packages/configs/src/languages/index.ts +0 -8
- package/packages/configs/src/languages/persian.ts +0 -42
- package/packages/configs/src/languages/polish.ts +0 -120
- package/packages/configs/src/languages/romanian.ts +0 -64
- package/packages/configs/src/languages/spanish.ts +0 -38
- package/packages/configs/src/languages/turkish.ts +0 -75
- package/packages/configs/tsconfig.json +0 -10
- package/packages/constants/README.md +0 -3
- package/packages/constants/build/index.d.ts +0 -12
- package/packages/constants/build/index.js +0 -12
- package/packages/constants/package.json +0 -30
- package/packages/constants/src/index.ts +0 -17
- package/packages/constants/tsconfig.json +0 -10
- package/packages/dictionaries/README.md +0 -3
- package/packages/dictionaries/bin/remove-dictionaries.js +0 -13
- package/packages/dictionaries/bin/update-dictionaries.js +0 -14
- package/packages/dictionaries/build/Dictionaries.d.ts +0 -12
- package/packages/dictionaries/build/Dictionaries.js +0 -53
- package/packages/dictionaries/build/constants.d.ts +0 -3
- package/packages/dictionaries/build/constants.js +0 -11
- package/packages/dictionaries/build/index.d.ts +0 -3
- package/packages/dictionaries/build/index.js +0 -20
- package/packages/dictionaries/build/lib/DiskCache.d.ts +0 -17
- package/packages/dictionaries/build/lib/DiskCache.js +0 -64
- package/packages/dictionaries/build/lib/LayeredCache.d.ts +0 -12
- package/packages/dictionaries/build/lib/LayeredCache.js +0 -53
- package/packages/dictionaries/build/lib/MemoryCache.d.ts +0 -12
- package/packages/dictionaries/build/lib/MemoryCache.js +0 -33
- package/packages/dictionaries/build/lib/createAsyncProxy.d.ts +0 -3
- package/packages/dictionaries/build/lib/createAsyncProxy.js +0 -19
- package/packages/dictionaries/build/lib/createCacheTimestampComparator.d.ts +0 -4
- package/packages/dictionaries/build/lib/createCacheTimestampComparator.js +0 -20
- package/packages/dictionaries/build/lib/downloadDictionary.d.ts +0 -3
- package/packages/dictionaries/build/lib/downloadDictionary.js +0 -20
- package/packages/dictionaries/build/lib/getDictionaryFilepath.d.ts +0 -2
- package/packages/dictionaries/build/lib/getDictionaryFilepath.js +0 -12
- package/packages/dictionaries/build/lib/index.d.ts +0 -7
- package/packages/dictionaries/build/lib/index.js +0 -17
- package/packages/dictionaries/build/types.d.ts +0 -7
- package/packages/dictionaries/build/types.js +0 -2
- package/packages/dictionaries/package.json +0 -46
- package/packages/dictionaries/src/Dictionaries.ts +0 -65
- package/packages/dictionaries/src/constants.ts +0 -8
- package/packages/dictionaries/src/index.ts +0 -5
- package/packages/dictionaries/src/lib/DiskCache.test.ts +0 -75
- package/packages/dictionaries/src/lib/DiskCache.ts +0 -75
- package/packages/dictionaries/src/lib/LayeredCache.ts +0 -67
- package/packages/dictionaries/src/lib/MemoryCache.ts +0 -40
- package/packages/dictionaries/src/lib/createAsyncProxy.ts +0 -18
- package/packages/dictionaries/src/lib/createCacheTimestampComparator.ts +0 -25
- package/packages/dictionaries/src/lib/downloadDictionary.ts +0 -21
- package/packages/dictionaries/src/lib/getDictionaryFilepath.ts +0 -8
- package/packages/dictionaries/src/lib/index.ts +0 -7
- package/packages/dictionaries/src/types.ts +0 -7
- package/packages/dictionaries/tsconfig.json +0 -10
- package/packages/logger/README.md +0 -21
- package/packages/logger/build/constants.d.ts +0 -4
- package/packages/logger/build/constants.js +0 -12
- package/packages/logger/build/describeError.d.ts +0 -5
- package/packages/logger/build/describeError.js +0 -23
- package/packages/logger/build/events.d.ts +0 -92
- package/packages/logger/build/events.js +0 -13
- package/packages/logger/build/formatCsvRow.d.ts +0 -2
- package/packages/logger/build/formatCsvRow.js +0 -20
- package/packages/logger/build/index.d.ts +0 -5
- package/packages/logger/build/index.js +0 -15
- package/packages/logger/build/logError.d.ts +0 -4
- package/packages/logger/build/logError.js +0 -17
- package/packages/logger/build/logEvent.d.ts +0 -3
- package/packages/logger/build/logEvent.js +0 -29
- package/packages/logger/package.json +0 -34
- package/packages/logger/scripts/export-csv.ts +0 -113
- package/packages/logger/scripts/readEvents.ts +0 -34
- package/packages/logger/scripts/tsconfig.json +0 -10
- package/packages/logger/src/constants.ts +0 -13
- package/packages/logger/src/describeError.test.ts +0 -44
- package/packages/logger/src/describeError.ts +0 -30
- package/packages/logger/src/events.ts +0 -103
- package/packages/logger/src/formatCsvRow.test.ts +0 -41
- package/packages/logger/src/formatCsvRow.ts +0 -24
- package/packages/logger/src/index.ts +0 -13
- package/packages/logger/src/logError.ts +0 -24
- package/packages/logger/src/logEvent.test.ts +0 -59
- package/packages/logger/src/logEvent.ts +0 -26
- package/packages/logger/tsconfig.json +0 -10
- package/packages/scrabble-solver/.next/BUILD_ID +0 -1
- package/packages/scrabble-solver/.next/diagnostics/build-diagnostics.json +0 -6
- package/packages/scrabble-solver/.next/diagnostics/framework.json +0 -1
- package/packages/scrabble-solver/.next/next-minimal-server.js.nft.json +0 -1
- package/packages/scrabble-solver/.next/next-server.js.nft.json +0 -1
- package/packages/scrabble-solver/.next/server/chunks/309.js +0 -1
- package/packages/scrabble-solver/.next/server/chunks/344.js +0 -1
- package/packages/scrabble-solver/.next/server/chunks/371.js +0 -1
- package/packages/scrabble-solver/.next/server/chunks/465.js +0 -1
- package/packages/scrabble-solver/.next/server/chunks/612.js +0 -5
- package/packages/scrabble-solver/.next/server/chunks/623.js +0 -1
- package/packages/scrabble-solver/.next/server/chunks/624.js +0 -1
- package/packages/scrabble-solver/.next/server/chunks/641.js +0 -1
- package/packages/scrabble-solver/.next/server/chunks/67.js +0 -1
- package/packages/scrabble-solver/.next/server/chunks/705.js +0 -1
- package/packages/scrabble-solver/.next/server/chunks/712.js +0 -1
- package/packages/scrabble-solver/.next/server/chunks/715.js +0 -1
- package/packages/scrabble-solver/.next/server/chunks/812.js +0 -1
- package/packages/scrabble-solver/.next/server/chunks/846.js +0 -1
- package/packages/scrabble-solver/.next/server/chunks/886.js +0 -1
- package/packages/scrabble-solver/.next/server/chunks/942.js +0 -1
- package/packages/scrabble-solver/.next/server/chunks/961.js +0 -1
- package/packages/scrabble-solver/.next/server/middleware-build-manifest.js +0 -1
- package/packages/scrabble-solver/.next/server/middleware-react-loadable-manifest.js +0 -1
- package/packages/scrabble-solver/.next/server/pages/404.html +0 -29
- package/packages/scrabble-solver/.next/server/pages/_app.js.nft.json +0 -1
- package/packages/scrabble-solver/.next/server/pages/_document.js +0 -28
- package/packages/scrabble-solver/.next/server/pages/_document.js.nft.json +0 -1
- package/packages/scrabble-solver/.next/server/pages/_error.js.nft.json +0 -1
- package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js +0 -2
- package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +0 -1
- package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale].js.nft.json +0 -1
- package/packages/scrabble-solver/.next/server/pages/api/solve.js +0 -1
- package/packages/scrabble-solver/.next/server/pages/api/solve.js.nft.json +0 -1
- package/packages/scrabble-solver/.next/server/pages/api/verify.js +0 -1
- package/packages/scrabble-solver/.next/server/pages/api/verify.js.nft.json +0 -1
- package/packages/scrabble-solver/.next/server/pages/api/visit.js.nft.json +0 -1
- package/packages/scrabble-solver/.next/server/pages/index.html +0 -29
- package/packages/scrabble-solver/.next/server/pages/index.js +0 -30
- package/packages/scrabble-solver/.next/server/pages/index.js.nft.json +0 -1
- package/packages/scrabble-solver/.next/server/pages/index.json +0 -1
- package/packages/scrabble-solver/.next/server/pages/not-found.js.nft.json +0 -1
- package/packages/scrabble-solver/.next/server/preview-props.json +0 -5
- package/packages/scrabble-solver/.next/server/route-cache/PAGES/8a5edab282632443219e051e4ade2d1d5bbc671c781051bf1437897cbdfea0f1/$/index.html +0 -29
- package/packages/scrabble-solver/.next/server/route-cache/PAGES/8a5edab282632443219e051e4ade2d1d5bbc671c781051bf1437897cbdfea0f1/$/index.json +0 -1
- package/packages/scrabble-solver/.next/server/webpack-api-runtime.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/100.305bdf9c75b1758f.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/256.9fcbd6c03ebdb85b.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/307.92ab8bd0b380a54b.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/363.1e1dca73189c1b3e.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/422.905bb771191013e7.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/601.d6817fd655b959d1.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/663.0b4d7a0e7f8e4ad3.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/693.1f53805be6ad36d1.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/820.c5e57d8b664cf9df.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/865.88d79c2c4b53cc8f.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/912.077603e4f0bc6cca.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/939.f8728029bfdc4515.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/pages/_app-5b1d356edb0d0f78.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/pages/index-c21b524ce1875d6e.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/pages/not-found-a59f9deeeff63d17.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/webpack-c4c264f86e0bb34b.js +0 -1
- package/packages/scrabble-solver/.next/static/css/8b8087461767360a.css +0 -1
- package/packages/scrabble-solver/.next/static/iJDkHROLsX-5CEsv2p6sC/_buildManifest.js +0 -1
- package/packages/scrabble-solver/.next/trace +0 -36
- package/packages/scrabble-solver/.next/trace-build +0 -1
- package/packages/scrabble-solver/.next/types/cache-life.d.ts +0 -114
- package/packages/scrabble-solver/.next/types/root-params.d.ts +0 -3
- package/packages/scrabble-solver/.next/types/routes.d.ts +0 -57
- package/packages/scrabble-solver/.next/types/validator.ts +0 -113
- package/packages/scrabble-solver/AGENTS.md +0 -9
- package/packages/scrabble-solver/CLAUDE.md +0 -1
- package/packages/scrabble-solver/README.md +0 -19
- package/packages/scrabble-solver/empty-module.js +0 -2
- package/packages/scrabble-solver/next-env.d.ts +0 -7
- package/packages/scrabble-solver/package.json +0 -99
- package/packages/scrabble-solver/public/service-worker.js.map +0 -1
- package/packages/scrabble-solver/scripts/generate-scss-types.ts +0 -112
- package/packages/scrabble-solver/src/@types/scss.d.ts +0 -6
- package/packages/scrabble-solver/src/@types/svg.d.ts +0 -7
- package/packages/scrabble-solver/src/api/BadRequestError.ts +0 -6
- package/packages/scrabble-solver/src/api/index.ts +0 -6
- package/packages/scrabble-solver/src/api/isBoardValid.ts +0 -41
- package/packages/scrabble-solver/src/api/isCellValid.ts +0 -25
- package/packages/scrabble-solver/src/api/isCharacterValid.ts +0 -12
- package/packages/scrabble-solver/src/api/isRowValid.ts +0 -17
- package/packages/scrabble-solver/src/api/withApiLog.ts +0 -85
- package/packages/scrabble-solver/src/components/Alert/Alert.module.scss +0 -52
- package/packages/scrabble-solver/src/components/Alert/Alert.module.scss.d.ts +0 -13
- package/packages/scrabble-solver/src/components/Alert/Alert.tsx +0 -44
- package/packages/scrabble-solver/src/components/Alert/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Badge/Badge.module.scss +0 -12
- package/packages/scrabble-solver/src/components/Badge/Badge.module.scss.d.ts +0 -6
- package/packages/scrabble-solver/src/components/Badge/Badge.tsx +0 -13
- package/packages/scrabble-solver/src/components/Badge/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Board/Board.module.scss +0 -83
- package/packages/scrabble-solver/src/components/Board/Board.module.scss.d.ts +0 -17
- package/packages/scrabble-solver/src/components/Board/Board.tsx +0 -221
- package/packages/scrabble-solver/src/components/Board/BoardPure.tsx +0 -166
- package/packages/scrabble-solver/src/components/Board/components/Actions/Actions.module.scss +0 -33
- package/packages/scrabble-solver/src/components/Board/components/Actions/Actions.module.scss.d.ts +0 -7
- package/packages/scrabble-solver/src/components/Board/components/Actions/Actions.tsx +0 -103
- package/packages/scrabble-solver/src/components/Board/components/Actions/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Board/components/Actions/lib.ts +0 -32
- package/packages/scrabble-solver/src/components/Board/components/Cell/Cell.module.scss +0 -99
- package/packages/scrabble-solver/src/components/Board/components/Cell/Cell.module.scss.d.ts +0 -13
- package/packages/scrabble-solver/src/components/Board/components/Cell/Cell.tsx +0 -135
- package/packages/scrabble-solver/src/components/Board/components/Cell/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Board/components/InputPrompt/InputPrompt.module.scss +0 -34
- package/packages/scrabble-solver/src/components/Board/components/InputPrompt/InputPrompt.module.scss.d.ts +0 -10
- package/packages/scrabble-solver/src/components/Board/components/InputPrompt/InputPrompt.tsx +0 -87
- package/packages/scrabble-solver/src/components/Board/components/InputPrompt/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Board/components/ToggleDirectionButton/ToggleDirectionButton.module.scss +0 -21
- package/packages/scrabble-solver/src/components/Board/components/ToggleDirectionButton/ToggleDirectionButton.module.scss.d.ts +0 -8
- package/packages/scrabble-solver/src/components/Board/components/ToggleDirectionButton/ToggleDirectionButton.tsx +0 -41
- package/packages/scrabble-solver/src/components/Board/components/ToggleDirectionButton/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Board/components/index.ts +0 -4
- package/packages/scrabble-solver/src/components/Board/getBoardBackground.ts +0 -175
- package/packages/scrabble-solver/src/components/Board/hooks/index.ts +0 -5
- package/packages/scrabble-solver/src/components/Board/hooks/useBoardStyle.ts +0 -24
- package/packages/scrabble-solver/src/components/Board/hooks/useFloatingActions.ts +0 -17
- package/packages/scrabble-solver/src/components/Board/hooks/useFloatingFocus.ts +0 -8
- package/packages/scrabble-solver/src/components/Board/hooks/useFloatingInputPrompt.ts +0 -17
- package/packages/scrabble-solver/src/components/Board/hooks/useGrid.ts +0 -390
- package/packages/scrabble-solver/src/components/Board/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Board/lib.test.ts +0 -106
- package/packages/scrabble-solver/src/components/Board/lib.ts +0 -149
- package/packages/scrabble-solver/src/components/Board/selectors.ts +0 -39
- package/packages/scrabble-solver/src/components/Button/Button.module.scss +0 -96
- package/packages/scrabble-solver/src/components/Button/Button.module.scss.d.ts +0 -12
- package/packages/scrabble-solver/src/components/Button/Button.tsx +0 -50
- package/packages/scrabble-solver/src/components/Button/Link.tsx +0 -45
- package/packages/scrabble-solver/src/components/Button/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Dictionary/Dictionary.module.scss +0 -65
- package/packages/scrabble-solver/src/components/Dictionary/Dictionary.module.scss.d.ts +0 -14
- package/packages/scrabble-solver/src/components/Dictionary/Dictionary.tsx +0 -78
- package/packages/scrabble-solver/src/components/Dictionary/index.ts +0 -1
- package/packages/scrabble-solver/src/components/DictionaryInput/DictionaryInput.module.scss +0 -12
- package/packages/scrabble-solver/src/components/DictionaryInput/DictionaryInput.module.scss.d.ts +0 -7
- package/packages/scrabble-solver/src/components/DictionaryInput/DictionaryInput.tsx +0 -45
- package/packages/scrabble-solver/src/components/DictionaryInput/index.ts +0 -1
- package/packages/scrabble-solver/src/components/EmptyState/EmptyState.module.scss +0 -14
- package/packages/scrabble-solver/src/components/EmptyState/EmptyState.module.scss.d.ts +0 -7
- package/packages/scrabble-solver/src/components/EmptyState/EmptyState.tsx +0 -55
- package/packages/scrabble-solver/src/components/EmptyState/index.ts +0 -1
- package/packages/scrabble-solver/src/components/IconButton/IconButton.module.scss +0 -39
- package/packages/scrabble-solver/src/components/IconButton/IconButton.module.scss.d.ts +0 -8
- package/packages/scrabble-solver/src/components/IconButton/IconButton.tsx +0 -31
- package/packages/scrabble-solver/src/components/IconButton/Link.tsx +0 -26
- package/packages/scrabble-solver/src/components/IconButton/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Key/Key.module.scss +0 -29
- package/packages/scrabble-solver/src/components/Key/Key.module.scss.d.ts +0 -6
- package/packages/scrabble-solver/src/components/Key/Key.tsx +0 -13
- package/packages/scrabble-solver/src/components/Key/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Keys/Arrows/Arrows.module.scss +0 -41
- package/packages/scrabble-solver/src/components/Keys/Arrows/Arrows.module.scss.d.ts +0 -11
- package/packages/scrabble-solver/src/components/Keys/Arrows/Arrows.tsx +0 -32
- package/packages/scrabble-solver/src/components/Keys/Arrows/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Keys/index.tsx +0 -28
- package/packages/scrabble-solver/src/components/Loading/Loading.module.scss +0 -33
- package/packages/scrabble-solver/src/components/Loading/Loading.module.scss.d.ts +0 -9
- package/packages/scrabble-solver/src/components/Loading/Loading.tsx +0 -37
- package/packages/scrabble-solver/src/components/Loading/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Logo/Logo.tsx +0 -12
- package/packages/scrabble-solver/src/components/Logo/LogoBlueprint.tsx +0 -22
- package/packages/scrabble-solver/src/components/Logo/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Modal/Modal.module.scss +0 -119
- package/packages/scrabble-solver/src/components/Modal/Modal.module.scss.d.ts +0 -15
- package/packages/scrabble-solver/src/components/Modal/Modal.tsx +0 -105
- package/packages/scrabble-solver/src/components/Modal/components/Section/Section.module.scss +0 -11
- package/packages/scrabble-solver/src/components/Modal/components/Section/Section.module.scss.d.ts +0 -7
- package/packages/scrabble-solver/src/components/Modal/components/Section/Section.tsx +0 -18
- package/packages/scrabble-solver/src/components/Modal/components/Section/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Modal/components/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Modal/index.ts +0 -1
- package/packages/scrabble-solver/src/components/NavButtons/NavButtons.module.scss +0 -53
- package/packages/scrabble-solver/src/components/NavButtons/NavButtons.module.scss.d.ts +0 -13
- package/packages/scrabble-solver/src/components/NavButtons/NavButtons.tsx +0 -127
- package/packages/scrabble-solver/src/components/NavButtons/index.ts +0 -1
- package/packages/scrabble-solver/src/components/NavButtons/selectors.ts +0 -11
- package/packages/scrabble-solver/src/components/NotFound/NotFound.module.scss +0 -37
- package/packages/scrabble-solver/src/components/NotFound/NotFound.module.scss.d.ts +0 -9
- package/packages/scrabble-solver/src/components/NotFound/NotFound.tsx +0 -18
- package/packages/scrabble-solver/src/components/NotFound/index.ts +0 -1
- package/packages/scrabble-solver/src/components/PlainTiles/PlainTiles.module.scss +0 -24
- package/packages/scrabble-solver/src/components/PlainTiles/PlainTiles.module.scss.d.ts +0 -11
- package/packages/scrabble-solver/src/components/PlainTiles/PlainTiles.tsx +0 -53
- package/packages/scrabble-solver/src/components/PlainTiles/Tile.tsx +0 -41
- package/packages/scrabble-solver/src/components/PlainTiles/index.ts +0 -1
- package/packages/scrabble-solver/src/components/PlainTiles/lib.ts +0 -75
- package/packages/scrabble-solver/src/components/PlainTiles/types.ts +0 -22
- package/packages/scrabble-solver/src/components/Progress/Progress.module.scss +0 -16
- package/packages/scrabble-solver/src/components/Progress/Progress.module.scss.d.ts +0 -6
- package/packages/scrabble-solver/src/components/Progress/Progress.tsx +0 -32
- package/packages/scrabble-solver/src/components/Progress/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Rack/Rack.module.scss +0 -95
- package/packages/scrabble-solver/src/components/Rack/Rack.module.scss.d.ts +0 -10
- package/packages/scrabble-solver/src/components/Rack/Rack.tsx +0 -199
- package/packages/scrabble-solver/src/components/Rack/components/InputPrompt/InputPrompt.module.scss +0 -21
- package/packages/scrabble-solver/src/components/Rack/components/InputPrompt/InputPrompt.module.scss.d.ts +0 -7
- package/packages/scrabble-solver/src/components/Rack/components/InputPrompt/InputPrompt.tsx +0 -73
- package/packages/scrabble-solver/src/components/Rack/components/InputPrompt/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Rack/components/InputPrompt/lib.test.ts +0 -27
- package/packages/scrabble-solver/src/components/Rack/components/InputPrompt/lib.ts +0 -17
- package/packages/scrabble-solver/src/components/Rack/components/RackTile/RackTile.module.scss +0 -11
- package/packages/scrabble-solver/src/components/Rack/components/RackTile/RackTile.module.scss.d.ts +0 -6
- package/packages/scrabble-solver/src/components/Rack/components/RackTile/RackTile.tsx +0 -165
- package/packages/scrabble-solver/src/components/Rack/components/RackTile/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Rack/components/index.ts +0 -2
- package/packages/scrabble-solver/src/components/Rack/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Rack/selectors.ts +0 -9
- package/packages/scrabble-solver/src/components/Radio/Radio.module.scss +0 -61
- package/packages/scrabble-solver/src/components/Radio/Radio.module.scss.d.ts +0 -12
- package/packages/scrabble-solver/src/components/Radio/Radio.tsx +0 -39
- package/packages/scrabble-solver/src/components/Radio/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Results/Header.tsx +0 -114
- package/packages/scrabble-solver/src/components/Results/Result.tsx +0 -101
- package/packages/scrabble-solver/src/components/Results/Results.module.scss +0 -76
- package/packages/scrabble-solver/src/components/Results/Results.module.scss.d.ts +0 -17
- package/packages/scrabble-solver/src/components/Results/Results.tsx +0 -164
- package/packages/scrabble-solver/src/components/Results/SolveButton.tsx +0 -45
- package/packages/scrabble-solver/src/components/Results/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Results/types.ts +0 -15
- package/packages/scrabble-solver/src/components/Solver/Solver.module.scss +0 -116
- package/packages/scrabble-solver/src/components/Solver/Solver.module.scss.d.ts +0 -20
- package/packages/scrabble-solver/src/components/Solver/Solver.tsx +0 -143
- package/packages/scrabble-solver/src/components/Solver/components/InsertButton/InsertButton.module.scss +0 -15
- package/packages/scrabble-solver/src/components/Solver/components/InsertButton/InsertButton.module.scss.d.ts +0 -7
- package/packages/scrabble-solver/src/components/Solver/components/InsertButton/InsertButton.tsx +0 -40
- package/packages/scrabble-solver/src/components/Solver/components/InsertButton/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.module.scss +0 -138
- package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.module.scss.d.ts +0 -19
- package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.tsx +0 -108
- package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Solver/components/index.ts +0 -2
- package/packages/scrabble-solver/src/components/Solver/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Spinner/Spinner.module.scss +0 -11
- package/packages/scrabble-solver/src/components/Spinner/Spinner.module.scss.d.ts +0 -10
- package/packages/scrabble-solver/src/components/Spinner/Spinner.tsx +0 -17
- package/packages/scrabble-solver/src/components/Spinner/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Table/Cell.tsx +0 -42
- package/packages/scrabble-solver/src/components/Table/Header.tsx +0 -11
- package/packages/scrabble-solver/src/components/Table/HeaderButton.tsx +0 -61
- package/packages/scrabble-solver/src/components/Table/Row.tsx +0 -59
- package/packages/scrabble-solver/src/components/Table/Search.tsx +0 -43
- package/packages/scrabble-solver/src/components/Table/Table.module.scss +0 -147
- package/packages/scrabble-solver/src/components/Table/Table.module.scss.d.ts +0 -19
- package/packages/scrabble-solver/src/components/Table/index.ts +0 -5
- package/packages/scrabble-solver/src/components/Tile/Tile.module.scss +0 -129
- package/packages/scrabble-solver/src/components/Tile/Tile.module.scss.d.ts +0 -19
- package/packages/scrabble-solver/src/components/Tile/Tile.tsx +0 -101
- package/packages/scrabble-solver/src/components/Tile/TilePure.tsx +0 -106
- package/packages/scrabble-solver/src/components/Tile/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Tooltip/Tooltip.module.scss +0 -15
- package/packages/scrabble-solver/src/components/Tooltip/Tooltip.module.scss.d.ts +0 -7
- package/packages/scrabble-solver/src/components/Tooltip/Tooltip.tsx +0 -42
- package/packages/scrabble-solver/src/components/Tooltip/TooltipContent.tsx +0 -53
- package/packages/scrabble-solver/src/components/Tooltip/TooltipTrigger.tsx +0 -30
- package/packages/scrabble-solver/src/components/Tooltip/context.ts +0 -17
- package/packages/scrabble-solver/src/components/Tooltip/index.ts +0 -1
- package/packages/scrabble-solver/src/components/Tooltip/useTooltip.ts +0 -55
- package/packages/scrabble-solver/src/hooks/useColumns.ts +0 -69
- package/packages/scrabble-solver/src/hooks/useDeferredRender.ts +0 -20
- package/packages/scrabble-solver/src/hooks/useDirection.ts +0 -21
- package/packages/scrabble-solver/src/hooks/useEffectOnce.ts +0 -11
- package/packages/scrabble-solver/src/hooks/useIsTouchDevice.ts +0 -5
- package/packages/scrabble-solver/src/hooks/useLanguage.ts +0 -20
- package/packages/scrabble-solver/src/hooks/useLatest.ts +0 -11
- package/packages/scrabble-solver/src/hooks/useLocalStorage.ts +0 -49
- package/packages/scrabble-solver/src/hooks/useMedia.ts +0 -34
- package/packages/scrabble-solver/src/hooks/useMediaQueries.ts +0 -11
- package/packages/scrabble-solver/src/hooks/useMediaQuery.ts +0 -10
- package/packages/scrabble-solver/src/i18n/constants.ts +0 -106
- package/packages/scrabble-solver/src/i18n/i18n.ts +0 -25
- package/packages/scrabble-solver/src/i18n/languages/english.json +0 -88
- package/packages/scrabble-solver/src/i18n/languages/french.json +0 -88
- package/packages/scrabble-solver/src/i18n/languages/german.json +0 -88
- package/packages/scrabble-solver/src/i18n/languages/persian.json +0 -88
- package/packages/scrabble-solver/src/i18n/languages/polish.json +0 -88
- package/packages/scrabble-solver/src/i18n/languages/romanian.json +0 -88
- package/packages/scrabble-solver/src/i18n/languages/spanish.json +0 -88
- package/packages/scrabble-solver/src/i18n/languages/turkish.json +0 -88
- package/packages/scrabble-solver/src/i18n/localeIcons.ts +0 -24
- package/packages/scrabble-solver/src/icons/ArrowDown.svg +0 -4
- package/packages/scrabble-solver/src/icons/ArrowLeft.svg +0 -4
- package/packages/scrabble-solver/src/icons/ArrowRight.svg +0 -4
- package/packages/scrabble-solver/src/icons/ArrowUp.svg +0 -4
- package/packages/scrabble-solver/src/icons/Ban.svg +0 -4
- package/packages/scrabble-solver/src/icons/BookHalf.svg +0 -4
- package/packages/scrabble-solver/src/icons/CardChecklist.svg +0 -5
- package/packages/scrabble-solver/src/icons/Check.svg +0 -4
- package/packages/scrabble-solver/src/icons/ChevronDown.svg +0 -4
- package/packages/scrabble-solver/src/icons/ChevronLeft.svg +0 -4
- package/packages/scrabble-solver/src/icons/ChevronRight.svg +0 -4
- package/packages/scrabble-solver/src/icons/Cog.svg +0 -4
- package/packages/scrabble-solver/src/icons/Cross.svg +0 -4
- package/packages/scrabble-solver/src/icons/CrossCircleFill.svg +0 -4
- package/packages/scrabble-solver/src/icons/CrossSquareFill.svg +0 -4
- package/packages/scrabble-solver/src/icons/DashCircleFill.svg +0 -4
- package/packages/scrabble-solver/src/icons/Eraser.svg +0 -4
- package/packages/scrabble-solver/src/icons/ExclamationSquareFill.svg +0 -4
- package/packages/scrabble-solver/src/icons/ExclamationTriangleFill.svg +0 -4
- package/packages/scrabble-solver/src/icons/EyeFill.svg +0 -5
- package/packages/scrabble-solver/src/icons/FlagDe.svg +0 -5
- package/packages/scrabble-solver/src/icons/FlagEs.svg +0 -4
- package/packages/scrabble-solver/src/icons/FlagFa.svg +0 -95
- package/packages/scrabble-solver/src/icons/FlagFill.svg +0 -4
- package/packages/scrabble-solver/src/icons/FlagFr.svg +0 -5
- package/packages/scrabble-solver/src/icons/FlagGb.svg +0 -10
- package/packages/scrabble-solver/src/icons/FlagPl.svg +0 -4
- package/packages/scrabble-solver/src/icons/FlagRo.svg +0 -5
- package/packages/scrabble-solver/src/icons/FlagTr.svg +0 -4
- package/packages/scrabble-solver/src/icons/FlagUs.svg +0 -33
- package/packages/scrabble-solver/src/icons/GeoAlt.svg +0 -5
- package/packages/scrabble-solver/src/icons/Github.svg +0 -4
- package/packages/scrabble-solver/src/icons/InfoCircleFill.svg +0 -4
- package/packages/scrabble-solver/src/icons/Keyboard.svg +0 -5
- package/packages/scrabble-solver/src/icons/KeyboardFill.svg +0 -4
- package/packages/scrabble-solver/src/icons/List.svg +0 -4
- package/packages/scrabble-solver/src/icons/OneTwoThree.svg +0 -4
- package/packages/scrabble-solver/src/icons/QuestionSquare.svg +0 -5
- package/packages/scrabble-solver/src/icons/Sack.svg +0 -4
- package/packages/scrabble-solver/src/icons/Search.svg +0 -4
- package/packages/scrabble-solver/src/icons/SortDown.svg +0 -4
- package/packages/scrabble-solver/src/icons/SortUp.svg +0 -4
- package/packages/scrabble-solver/src/icons/Square.svg +0 -4
- package/packages/scrabble-solver/src/icons/SquareA.svg +0 -6
- package/packages/scrabble-solver/src/icons/SquareB.svg +0 -6
- package/packages/scrabble-solver/src/icons/SquareFill.svg +0 -4
- package/packages/scrabble-solver/src/icons/Squares.svg +0 -34
- package/packages/scrabble-solver/src/icons/Words.svg +0 -22
- package/packages/scrabble-solver/src/lib/arrayEquals.ts +0 -3
- package/packages/scrabble-solver/src/lib/createComparator.ts +0 -20
- package/packages/scrabble-solver/src/lib/createCoordinatesComparator.ts +0 -23
- package/packages/scrabble-solver/src/lib/createHighlightWords.test.ts +0 -13
- package/packages/scrabble-solver/src/lib/createHighlightWords.ts +0 -9
- package/packages/scrabble-solver/src/lib/createKeyComparator.ts +0 -23
- package/packages/scrabble-solver/src/lib/createKeyboardNavigation.ts +0 -46
- package/packages/scrabble-solver/src/lib/createNullMovingComparator.test.ts +0 -15
- package/packages/scrabble-solver/src/lib/createNullMovingComparator.ts +0 -17
- package/packages/scrabble-solver/src/lib/createRegExp.ts +0 -11
- package/packages/scrabble-solver/src/lib/createSortComparator.ts +0 -22
- package/packages/scrabble-solver/src/lib/createStringComparator.ts +0 -7
- package/packages/scrabble-solver/src/lib/extractCharacters.test.ts +0 -52
- package/packages/scrabble-solver/src/lib/extractCharacters.ts +0 -42
- package/packages/scrabble-solver/src/lib/extractInputValue.ts +0 -15
- package/packages/scrabble-solver/src/lib/findCell.ts +0 -5
- package/packages/scrabble-solver/src/lib/getCoordinate.test.ts +0 -22
- package/packages/scrabble-solver/src/lib/getCoordinate.ts +0 -17
- package/packages/scrabble-solver/src/lib/getCoordinates.test.ts +0 -21
- package/packages/scrabble-solver/src/lib/getCoordinates.ts +0 -16
- package/packages/scrabble-solver/src/lib/getNextSort.ts +0 -12
- package/packages/scrabble-solver/src/lib/inverseDirection.ts +0 -3
- package/packages/scrabble-solver/src/lib/isCtrl.ts +0 -5
- package/packages/scrabble-solver/src/lib/isMac.ts +0 -7
- package/packages/scrabble-solver/src/lib/isRegExp.ts +0 -9
- package/packages/scrabble-solver/src/lib/isStringArray.ts +0 -3
- package/packages/scrabble-solver/src/lib/localeTransliterate.test.ts +0 -19
- package/packages/scrabble-solver/src/lib/localeTransliterate.ts +0 -38
- package/packages/scrabble-solver/src/lib/memoize.ts +0 -64
- package/packages/scrabble-solver/src/lib/noop.ts +0 -1
- package/packages/scrabble-solver/src/lib/numberComparator.ts +0 -3
- package/packages/scrabble-solver/src/lib/reverseComparator.ts +0 -5
- package/packages/scrabble-solver/src/lib/unorderedArraysEqual.ts +0 -12
- package/packages/scrabble-solver/src/lib/waitForIdleOrFirstIntent.ts +0 -44
- package/packages/scrabble-solver/src/lib/zipCharactersAndTiles.ts +0 -28
- package/packages/scrabble-solver/src/modals/DictionaryModal/DictionaryModal.module.scss +0 -22
- package/packages/scrabble-solver/src/modals/DictionaryModal/DictionaryModal.module.scss.d.ts +0 -8
- package/packages/scrabble-solver/src/modals/DictionaryModal/DictionaryModal.tsx +0 -29
- package/packages/scrabble-solver/src/modals/DictionaryModal/index.ts +0 -1
- package/packages/scrabble-solver/src/modals/KeyMapModal/KeyMapModal.tsx +0 -65
- package/packages/scrabble-solver/src/modals/KeyMapModal/components/Mapping/Mapping.module.scss +0 -48
- package/packages/scrabble-solver/src/modals/KeyMapModal/components/Mapping/Mapping.module.scss.d.ts +0 -11
- package/packages/scrabble-solver/src/modals/KeyMapModal/components/Mapping/Mapping.tsx +0 -36
- package/packages/scrabble-solver/src/modals/KeyMapModal/components/Mapping/index.ts +0 -1
- package/packages/scrabble-solver/src/modals/KeyMapModal/components/index.ts +0 -1
- package/packages/scrabble-solver/src/modals/KeyMapModal/index.ts +0 -1
- package/packages/scrabble-solver/src/modals/MenuModal/MenuModal.module.scss +0 -48
- package/packages/scrabble-solver/src/modals/MenuModal/MenuModal.module.scss.d.ts +0 -10
- package/packages/scrabble-solver/src/modals/MenuModal/MenuModal.tsx +0 -93
- package/packages/scrabble-solver/src/modals/MenuModal/index.ts +0 -1
- package/packages/scrabble-solver/src/modals/RemainingTilesModal/RemainingTilesModal.module.scss +0 -25
- package/packages/scrabble-solver/src/modals/RemainingTilesModal/RemainingTilesModal.module.scss.d.ts +0 -9
- package/packages/scrabble-solver/src/modals/RemainingTilesModal/RemainingTilesModal.tsx +0 -61
- package/packages/scrabble-solver/src/modals/RemainingTilesModal/components/Character/Character.module.scss +0 -50
- package/packages/scrabble-solver/src/modals/RemainingTilesModal/components/Character/Character.module.scss.d.ts +0 -12
- package/packages/scrabble-solver/src/modals/RemainingTilesModal/components/Character/Character.tsx +0 -89
- package/packages/scrabble-solver/src/modals/RemainingTilesModal/components/Character/index.ts +0 -1
- package/packages/scrabble-solver/src/modals/RemainingTilesModal/components/index.ts +0 -1
- package/packages/scrabble-solver/src/modals/RemainingTilesModal/index.ts +0 -1
- package/packages/scrabble-solver/src/modals/RemainingTilesModal/lib.ts +0 -81
- package/packages/scrabble-solver/src/modals/RemainingTilesModal/selectors.ts +0 -7
- package/packages/scrabble-solver/src/modals/ResultsModal/ResultsModal.module.scss +0 -20
- package/packages/scrabble-solver/src/modals/ResultsModal/ResultsModal.module.scss.d.ts +0 -8
- package/packages/scrabble-solver/src/modals/ResultsModal/ResultsModal.tsx +0 -107
- package/packages/scrabble-solver/src/modals/ResultsModal/index.ts +0 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/SettingsModal.tsx +0 -65
- package/packages/scrabble-solver/src/modals/SettingsModal/components/AutoGroupTilesSetting/AutoGroupTilesSetting.module.scss +0 -12
- package/packages/scrabble-solver/src/modals/SettingsModal/components/AutoGroupTilesSetting/AutoGroupTilesSetting.module.scss.d.ts +0 -7
- package/packages/scrabble-solver/src/modals/SettingsModal/components/AutoGroupTilesSetting/AutoGroupTilesSetting.tsx +0 -58
- package/packages/scrabble-solver/src/modals/SettingsModal/components/AutoGroupTilesSetting/constants.ts +0 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/components/AutoGroupTilesSetting/index.ts +0 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/components/AutoGroupTilesSetting/lib.ts +0 -15
- package/packages/scrabble-solver/src/modals/SettingsModal/components/ConfigSetting/ConfigSetting.module.scss +0 -12
- package/packages/scrabble-solver/src/modals/SettingsModal/components/ConfigSetting/ConfigSetting.module.scss.d.ts +0 -7
- package/packages/scrabble-solver/src/modals/SettingsModal/components/ConfigSetting/ConfigSetting.tsx +0 -45
- package/packages/scrabble-solver/src/modals/SettingsModal/components/ConfigSetting/index.ts +0 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/components/ConfigSetting/lib.ts +0 -19
- package/packages/scrabble-solver/src/modals/SettingsModal/components/HighlightUnreachableCellsSetting/HighlightUnreachableCellsSetting.module.scss +0 -12
- package/packages/scrabble-solver/src/modals/SettingsModal/components/HighlightUnreachableCellsSetting/HighlightUnreachableCellsSetting.module.scss.d.ts +0 -7
- package/packages/scrabble-solver/src/modals/SettingsModal/components/HighlightUnreachableCellsSetting/HighlightUnreachableCellsSetting.tsx +0 -51
- package/packages/scrabble-solver/src/modals/SettingsModal/components/HighlightUnreachableCellsSetting/index.ts +0 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/components/InputModeSetting/InputModeSetting.module.scss +0 -12
- package/packages/scrabble-solver/src/modals/SettingsModal/components/InputModeSetting/InputModeSetting.module.scss.d.ts +0 -7
- package/packages/scrabble-solver/src/modals/SettingsModal/components/InputModeSetting/InputModeSetting.tsx +0 -53
- package/packages/scrabble-solver/src/modals/SettingsModal/components/InputModeSetting/index.ts +0 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/components/InputModeSetting/lib.ts +0 -13
- package/packages/scrabble-solver/src/modals/SettingsModal/components/LocaleSetting/LocaleSetting.module.scss +0 -20
- package/packages/scrabble-solver/src/modals/SettingsModal/components/LocaleSetting/LocaleSetting.module.scss.d.ts +0 -8
- package/packages/scrabble-solver/src/modals/SettingsModal/components/LocaleSetting/LocaleSetting.tsx +0 -54
- package/packages/scrabble-solver/src/modals/SettingsModal/components/LocaleSetting/index.ts +0 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/components/RemoveCellFiltersSetting/RemoveCellFiltersSetting.module.scss +0 -12
- package/packages/scrabble-solver/src/modals/SettingsModal/components/RemoveCellFiltersSetting/RemoveCellFiltersSetting.module.scss.d.ts +0 -7
- package/packages/scrabble-solver/src/modals/SettingsModal/components/RemoveCellFiltersSetting/RemoveCellFiltersSetting.tsx +0 -53
- package/packages/scrabble-solver/src/modals/SettingsModal/components/RemoveCellFiltersSetting/index.ts +0 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/components/RemoveCellFiltersSetting/lib.ts +0 -13
- package/packages/scrabble-solver/src/modals/SettingsModal/components/ShowCoordinatesSetting/ShowCoordinatesSetting.module.scss +0 -12
- package/packages/scrabble-solver/src/modals/SettingsModal/components/ShowCoordinatesSetting/ShowCoordinatesSetting.module.scss.d.ts +0 -7
- package/packages/scrabble-solver/src/modals/SettingsModal/components/ShowCoordinatesSetting/ShowCoordinatesSetting.tsx +0 -53
- package/packages/scrabble-solver/src/modals/SettingsModal/components/ShowCoordinatesSetting/index.ts +0 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/components/index.ts +0 -7
- package/packages/scrabble-solver/src/modals/SettingsModal/index.ts +0 -1
- package/packages/scrabble-solver/src/modals/WordsModal/WordsModal.module.scss +0 -24
- package/packages/scrabble-solver/src/modals/WordsModal/WordsModal.module.scss.d.ts +0 -8
- package/packages/scrabble-solver/src/modals/WordsModal/WordsModal.tsx +0 -75
- package/packages/scrabble-solver/src/modals/WordsModal/components/WordsTable/WordRow.tsx +0 -97
- package/packages/scrabble-solver/src/modals/WordsModal/components/WordsTable/WordsTable.module.scss +0 -69
- package/packages/scrabble-solver/src/modals/WordsModal/components/WordsTable/WordsTable.module.scss.d.ts +0 -16
- package/packages/scrabble-solver/src/modals/WordsModal/components/WordsTable/WordsTable.tsx +0 -137
- package/packages/scrabble-solver/src/modals/WordsModal/components/WordsTable/index.ts +0 -1
- package/packages/scrabble-solver/src/modals/WordsModal/components/index.ts +0 -1
- package/packages/scrabble-solver/src/modals/WordsModal/index.ts +0 -1
- package/packages/scrabble-solver/src/modals/preload.ts +0 -24
- package/packages/scrabble-solver/src/pages/_app.tsx +0 -52
- package/packages/scrabble-solver/src/pages/_document.tsx +0 -129
- package/packages/scrabble-solver/src/pages/api/dictionary/[locale]/[word].ts +0 -66
- package/packages/scrabble-solver/src/pages/api/dictionary/[locale]/index.ts +0 -123
- package/packages/scrabble-solver/src/pages/api/solve.ts +0 -103
- package/packages/scrabble-solver/src/pages/api/verify.ts +0 -78
- package/packages/scrabble-solver/src/pages/api/visit.ts +0 -44
- package/packages/scrabble-solver/src/pages/index.module.scss +0 -31
- package/packages/scrabble-solver/src/pages/index.module.scss.d.ts +0 -11
- package/packages/scrabble-solver/src/pages/index.tsx +0 -274
- package/packages/scrabble-solver/src/pages/not-found.tsx +0 -16
- package/packages/scrabble-solver/src/parameters/index.ts +0 -83
- package/packages/scrabble-solver/src/sdk/fetch.ts +0 -28
- package/packages/scrabble-solver/src/sdk/fetchJson.ts +0 -9
- package/packages/scrabble-solver/src/sdk/findWordDefinitions.ts +0 -8
- package/packages/scrabble-solver/src/sdk/index.ts +0 -4
- package/packages/scrabble-solver/src/sdk/solve.ts +0 -19
- package/packages/scrabble-solver/src/sdk/verify.ts +0 -20
- package/packages/scrabble-solver/src/sdk/visit.ts +0 -10
- package/packages/scrabble-solver/src/service-worker/appShell.test.ts +0 -86
- package/packages/scrabble-solver/src/service-worker/appShell.ts +0 -39
- package/packages/scrabble-solver/src/service-worker/index.ts +0 -22
- package/packages/scrabble-solver/src/serviceWorkerManager.ts +0 -12
- package/packages/scrabble-solver/src/solver-worker/client.test.ts +0 -158
- package/packages/scrabble-solver/src/solver-worker/client.ts +0 -106
- package/packages/scrabble-solver/src/solver-worker/dictionaries/constants.ts +0 -9
- package/packages/scrabble-solver/src/solver-worker/dictionaries/expirationManager.ts +0 -7
- package/packages/scrabble-solver/src/solver-worker/dictionaries/getDictionary.ts +0 -21
- package/packages/scrabble-solver/src/solver-worker/dictionaries/getDictionaryUrl.ts +0 -5
- package/packages/scrabble-solver/src/solver-worker/dictionaries/index.ts +0 -2
- package/packages/scrabble-solver/src/solver-worker/dictionaries/revalidateDictionary.test.ts +0 -199
- package/packages/scrabble-solver/src/solver-worker/dictionaries/revalidateDictionary.ts +0 -86
- package/packages/scrabble-solver/src/solver-worker/dictionaries/revalidatedAt.ts +0 -43
- package/packages/scrabble-solver/src/solver-worker/getGaddag.test.ts +0 -109
- package/packages/scrabble-solver/src/solver-worker/getGaddag.ts +0 -62
- package/packages/scrabble-solver/src/solver-worker/index.ts +0 -1
- package/packages/scrabble-solver/src/solver-worker/index.worker.ts +0 -124
- package/packages/scrabble-solver/src/solver-worker/messages.ts +0 -20
- package/packages/scrabble-solver/src/state/actions.ts +0 -5
- package/packages/scrabble-solver/src/state/app/index.ts +0 -4
- package/packages/scrabble-solver/src/state/app/initialState.ts +0 -6
- package/packages/scrabble-solver/src/state/app/selectors.ts +0 -5
- package/packages/scrabble-solver/src/state/app/slice.ts +0 -20
- package/packages/scrabble-solver/src/state/app/types.ts +0 -4
- package/packages/scrabble-solver/src/state/board/index.ts +0 -4
- package/packages/scrabble-solver/src/state/board/initialState.ts +0 -38
- package/packages/scrabble-solver/src/state/board/selectors.ts +0 -3
- package/packages/scrabble-solver/src/state/board/slice.ts +0 -101
- package/packages/scrabble-solver/src/state/board/types.ts +0 -3
- package/packages/scrabble-solver/src/state/cellFilters/index.ts +0 -4
- package/packages/scrabble-solver/src/state/cellFilters/initialState.ts +0 -3
- package/packages/scrabble-solver/src/state/cellFilters/lib.ts +0 -8
- package/packages/scrabble-solver/src/state/cellFilters/selectors.ts +0 -13
- package/packages/scrabble-solver/src/state/cellFilters/slice.ts +0 -49
- package/packages/scrabble-solver/src/state/cellFilters/types.ts +0 -3
- package/packages/scrabble-solver/src/state/dictionary/index.ts +0 -4
- package/packages/scrabble-solver/src/state/dictionary/initialState.ts +0 -8
- package/packages/scrabble-solver/src/state/dictionary/selectors.ts +0 -16
- package/packages/scrabble-solver/src/state/dictionary/slice.ts +0 -34
- package/packages/scrabble-solver/src/state/dictionary/types.ts +0 -8
- package/packages/scrabble-solver/src/state/hoveredTile/index.ts +0 -4
- package/packages/scrabble-solver/src/state/hoveredTile/initialState.ts +0 -5
- package/packages/scrabble-solver/src/state/hoveredTile/selectors.ts +0 -3
- package/packages/scrabble-solver/src/state/hoveredTile/slice.ts +0 -16
- package/packages/scrabble-solver/src/state/hoveredTile/types.ts +0 -3
- package/packages/scrabble-solver/src/state/hoveredWord/index.ts +0 -4
- package/packages/scrabble-solver/src/state/hoveredWord/initialState.ts +0 -5
- package/packages/scrabble-solver/src/state/hoveredWord/selectors.ts +0 -5
- package/packages/scrabble-solver/src/state/hoveredWord/slice.ts +0 -18
- package/packages/scrabble-solver/src/state/hoveredWord/types.ts +0 -5
- package/packages/scrabble-solver/src/state/i18n/index.ts +0 -4
- package/packages/scrabble-solver/src/state/i18n/initialState.ts +0 -5
- package/packages/scrabble-solver/src/state/i18n/selectors.ts +0 -3
- package/packages/scrabble-solver/src/state/i18n/slice.ts +0 -16
- package/packages/scrabble-solver/src/state/i18n/types.ts +0 -7
- package/packages/scrabble-solver/src/state/index.ts +0 -19
- package/packages/scrabble-solver/src/state/lib.ts +0 -46
- package/packages/scrabble-solver/src/state/localStorage.ts +0 -142
- package/packages/scrabble-solver/src/state/rack/index.ts +0 -4
- package/packages/scrabble-solver/src/state/rack/initialState.ts +0 -11
- package/packages/scrabble-solver/src/state/rack/selectors.ts +0 -7
- package/packages/scrabble-solver/src/state/rack/slice.ts +0 -56
- package/packages/scrabble-solver/src/state/rack/types.ts +0 -3
- package/packages/scrabble-solver/src/state/results/index.ts +0 -4
- package/packages/scrabble-solver/src/state/results/initialState.ts +0 -13
- package/packages/scrabble-solver/src/state/results/lib.ts +0 -86
- package/packages/scrabble-solver/src/state/results/selectors.ts +0 -83
- package/packages/scrabble-solver/src/state/results/slice.ts +0 -43
- package/packages/scrabble-solver/src/state/results/types.ts +0 -10
- package/packages/scrabble-solver/src/state/sagas.ts +0 -395
- package/packages/scrabble-solver/src/state/selectors.ts +0 -52
- package/packages/scrabble-solver/src/state/settings/index.ts +0 -4
- package/packages/scrabble-solver/src/state/settings/initialState.ts +0 -16
- package/packages/scrabble-solver/src/state/settings/lib.ts +0 -42
- package/packages/scrabble-solver/src/state/settings/selectors.ts +0 -78
- package/packages/scrabble-solver/src/state/settings/slice.ts +0 -54
- package/packages/scrabble-solver/src/state/settings/types.ts +0 -13
- package/packages/scrabble-solver/src/state/solve/index.ts +0 -4
- package/packages/scrabble-solver/src/state/solve/initialState.ts +0 -12
- package/packages/scrabble-solver/src/state/solve/selectors.ts +0 -14
- package/packages/scrabble-solver/src/state/solve/slice.ts +0 -33
- package/packages/scrabble-solver/src/state/solve/types.ts +0 -10
- package/packages/scrabble-solver/src/state/store.ts +0 -38
- package/packages/scrabble-solver/src/state/types.ts +0 -27
- package/packages/scrabble-solver/src/state/useTranslate.ts +0 -32
- package/packages/scrabble-solver/src/state/useTypedSelector.ts +0 -5
- package/packages/scrabble-solver/src/state/useTypedStore.ts +0 -6
- package/packages/scrabble-solver/src/state/verify/index.ts +0 -4
- package/packages/scrabble-solver/src/state/verify/initialState.ts +0 -19
- package/packages/scrabble-solver/src/state/verify/lib.test.ts +0 -55
- package/packages/scrabble-solver/src/state/verify/lib.ts +0 -49
- package/packages/scrabble-solver/src/state/verify/selectors.ts +0 -46
- package/packages/scrabble-solver/src/state/verify/slice.ts +0 -40
- package/packages/scrabble-solver/src/state/verify/types.ts +0 -14
- package/packages/scrabble-solver/src/styles/_tokens.scss +0 -60
- package/packages/scrabble-solver/src/styles/animations.scss +0 -49
- package/packages/scrabble-solver/src/styles/global.scss +0 -61
- package/packages/scrabble-solver/src/styles/mixins.scss +0 -117
- package/packages/scrabble-solver/src/styles/variables.module.scss +0 -32
- package/packages/scrabble-solver/src/styles/variables.module.scss.d.ts +0 -27
- package/packages/scrabble-solver/src/styles/variables.scss +0 -176
- package/packages/scrabble-solver/src/types/api.ts +0 -21
- package/packages/scrabble-solver/src/types/index.ts +0 -177
- package/packages/scrabble-solver/tsconfig.json +0 -27
- package/packages/scrabble-solver/tsconfig.tsbuildinfo +0 -1
- package/packages/solver/README.md +0 -29
- package/packages/solver/benchmarks/index.ts +0 -15
- package/packages/solver/benchmarks/lib.ts +0 -31
- package/packages/solver/benchmarks/renderChart.ts +0 -165
- package/packages/solver/benchmarks/results/chart.svg +0 -65
- package/packages/solver/benchmarks/runBenchmarks.ts +0 -66
- package/packages/solver/benchmarks/scenarios.ts +0 -64
- package/packages/solver/benchmarks/types.ts +0 -16
- package/packages/solver/benchmarks/updateReadme.ts +0 -53
- package/packages/solver/build/MoveGenerator.d.ts +0 -116
- package/packages/solver/build/MoveGenerator.js +0 -686
- package/packages/solver/build/index.d.ts +0 -1
- package/packages/solver/build/index.js +0 -5
- package/packages/solver/build/solve.d.ts +0 -3
- package/packages/solver/build/solve.js +0 -8
- package/packages/solver/package.json +0 -45
- package/packages/solver/src/MoveGenerator.test.ts +0 -1009
- package/packages/solver/src/MoveGenerator.ts +0 -926
- package/packages/solver/src/ReferenceSolver.ts +0 -401
- package/packages/solver/src/index.ts +0 -1
- package/packages/solver/src/solve.test.ts +0 -225
- package/packages/solver/src/solve.ts +0 -8
- package/packages/solver/tsconfig.json +0 -10
- package/packages/types/README.md +0 -3
- package/packages/types/build/Bingo.d.ts +0 -7
- package/packages/types/build/Bingo.js +0 -2
- package/packages/types/build/Board.d.ts +0 -33
- package/packages/types/build/Board.js +0 -106
- package/packages/types/build/BoardJson.d.ts +0 -2
- package/packages/types/build/BoardJson.js +0 -2
- package/packages/types/build/BoardWord.d.ts +0 -7
- package/packages/types/build/BoardWord.js +0 -2
- package/packages/types/build/Bonus.d.ts +0 -22
- package/packages/types/build/Bonus.js +0 -33
- package/packages/types/build/BonusJson.d.ts +0 -7
- package/packages/types/build/BonusJson.js +0 -2
- package/packages/types/build/BonusValue.d.ts +0 -4
- package/packages/types/build/BonusValue.js +0 -2
- package/packages/types/build/Cell.d.ts +0 -22
- package/packages/types/build/Cell.js +0 -52
- package/packages/types/build/CellJson.d.ts +0 -7
- package/packages/types/build/CellJson.js +0 -2
- package/packages/types/build/CharacterBonus.d.ts +0 -10
- package/packages/types/build/CharacterBonus.js +0 -27
- package/packages/types/build/Collision.d.ts +0 -2
- package/packages/types/build/Collision.js +0 -2
- package/packages/types/build/Config.d.ts +0 -36
- package/packages/types/build/Config.js +0 -105
- package/packages/types/build/ConfigJson.d.ts +0 -18
- package/packages/types/build/ConfigJson.js +0 -2
- package/packages/types/build/Dictionary.d.ts +0 -6
- package/packages/types/build/Dictionary.js +0 -2
- package/packages/types/build/Direction.d.ts +0 -1
- package/packages/types/build/Direction.js +0 -2
- package/packages/types/build/Game.d.ts +0 -11
- package/packages/types/build/Game.js +0 -15
- package/packages/types/build/Locale.d.ts +0 -16
- package/packages/types/build/Locale.js +0 -20
- package/packages/types/build/Result.d.ts +0 -32
- package/packages/types/build/Result.js +0 -61
- package/packages/types/build/ResultJson.d.ts +0 -9
- package/packages/types/build/ResultJson.js +0 -2
- package/packages/types/build/ShowCoordinates.d.ts +0 -5
- package/packages/types/build/ShowCoordinates.js +0 -2
- package/packages/types/build/TextDirection.d.ts +0 -1
- package/packages/types/build/TextDirection.js +0 -2
- package/packages/types/build/Tile.d.ts +0 -15
- package/packages/types/build/Tile.js +0 -46
- package/packages/types/build/TileConfig.d.ts +0 -5
- package/packages/types/build/TileConfig.js +0 -2
- package/packages/types/build/TileJson.d.ts +0 -4
- package/packages/types/build/TileJson.js +0 -2
- package/packages/types/build/WordBonus.d.ts +0 -6
- package/packages/types/build/WordBonus.js +0 -18
- package/packages/types/build/WordDefinition.d.ts +0 -17
- package/packages/types/build/WordDefinition.js +0 -38
- package/packages/types/build/WordDefinitionJson.d.ts +0 -12
- package/packages/types/build/WordDefinitionJson.js +0 -2
- package/packages/types/build/index.d.ts +0 -29
- package/packages/types/build/index.js +0 -38
- package/packages/types/build/lib/getBoardWords.d.ts +0 -3
- package/packages/types/build/lib/getBoardWords.js +0 -10
- package/packages/types/build/lib/getCells.d.ts +0 -4
- package/packages/types/build/lib/getCells.js +0 -27
- package/packages/types/build/lib/getCollidingWords.d.ts +0 -3
- package/packages/types/build/lib/getCollidingWords.js +0 -19
- package/packages/types/build/lib/getCollision.d.ts +0 -3
- package/packages/types/build/lib/getCollision.js +0 -31
- package/packages/types/build/lib/getCollisions.d.ts +0 -3
- package/packages/types/build/lib/getCollisions.js +0 -17
- package/packages/types/build/lib/getPlacedCell.d.ts +0 -3
- package/packages/types/build/lib/getPlacedCell.js +0 -10
- package/packages/types/build/lib/getWordThrough.d.ts +0 -4
- package/packages/types/build/lib/getWordThrough.js +0 -23
- package/packages/types/build/lib/getWordsInRows.d.ts +0 -8
- package/packages/types/build/lib/getWordsInRows.js +0 -29
- package/packages/types/build/lib/index.d.ts +0 -5
- package/packages/types/build/lib/index.js +0 -21
- package/packages/types/build/lib/isSameBoardWord.d.ts +0 -2
- package/packages/types/build/lib/isSameBoardWord.js +0 -6
- package/packages/types/build/lib/toBoardWord.d.ts +0 -4
- package/packages/types/build/lib/toBoardWord.js +0 -11
- package/packages/types/build/lib/transpose.d.ts +0 -1
- package/packages/types/build/lib/transpose.js +0 -16
- package/packages/types/build/type-guards/index.d.ts +0 -10
- package/packages/types/build/type-guards/index.js +0 -23
- package/packages/types/build/type-guards/isBingo.d.ts +0 -2
- package/packages/types/build/type-guards/isBingo.js +0 -9
- package/packages/types/build/type-guards/isBoardJson.d.ts +0 -2
- package/packages/types/build/type-guards/isBoardJson.js +0 -21
- package/packages/types/build/type-guards/isCellJson.d.ts +0 -2
- package/packages/types/build/type-guards/isCellJson.js +0 -13
- package/packages/types/build/type-guards/isError.d.ts +0 -1
- package/packages/types/build/type-guards/isError.js +0 -11
- package/packages/types/build/type-guards/isGame.d.ts +0 -2
- package/packages/types/build/type-guards/isGame.js +0 -7
- package/packages/types/build/type-guards/isLocale.d.ts +0 -2
- package/packages/types/build/type-guards/isLocale.js +0 -7
- package/packages/types/build/type-guards/isMultiplierBingo.d.ts +0 -2
- package/packages/types/build/type-guards/isMultiplierBingo.js +0 -8
- package/packages/types/build/type-guards/isObject.d.ts +0 -1
- package/packages/types/build/type-guards/isObject.js +0 -7
- package/packages/types/build/type-guards/isScoreBingo.d.ts +0 -2
- package/packages/types/build/type-guards/isScoreBingo.js +0 -8
- package/packages/types/build/type-guards/isTileJson.d.ts +0 -2
- package/packages/types/build/type-guards/isTileJson.js +0 -8
- package/packages/types/package.json +0 -37
- package/packages/types/src/Bingo.ts +0 -5
- package/packages/types/src/Board.test.ts +0 -85
- package/packages/types/src/Board.ts +0 -141
- package/packages/types/src/BoardJson.ts +0 -3
- package/packages/types/src/BoardWord.ts +0 -8
- package/packages/types/src/Bonus.ts +0 -50
- package/packages/types/src/BonusJson.ts +0 -7
- package/packages/types/src/BonusValue.ts +0 -4
- package/packages/types/src/Cell.ts +0 -66
- package/packages/types/src/CellJson.ts +0 -8
- package/packages/types/src/CharacterBonus.ts +0 -29
- package/packages/types/src/Collision.ts +0 -3
- package/packages/types/src/Config.ts +0 -152
- package/packages/types/src/ConfigJson.ts +0 -19
- package/packages/types/src/Dictionary.ts +0 -7
- package/packages/types/src/Direction.ts +0 -1
- package/packages/types/src/Game.ts +0 -11
- package/packages/types/src/Locale.ts +0 -16
- package/packages/types/src/Result.ts +0 -118
- package/packages/types/src/ResultJson.ts +0 -9
- package/packages/types/src/ShowCoordinates.ts +0 -5
- package/packages/types/src/TextDirection.ts +0 -1
- package/packages/types/src/Tile.ts +0 -56
- package/packages/types/src/TileConfig.ts +0 -5
- package/packages/types/src/TileJson.ts +0 -4
- package/packages/types/src/WordBonus.ts +0 -15
- package/packages/types/src/WordDefinition.ts +0 -54
- package/packages/types/src/WordDefinitionJson.ts +0 -12
- package/packages/types/src/index.ts +0 -40
- package/packages/types/src/lib/getBoardWords.ts +0 -11
- package/packages/types/src/lib/getCells.test.ts +0 -127
- package/packages/types/src/lib/getCells.ts +0 -31
- package/packages/types/src/lib/getCollidingWords.ts +0 -25
- package/packages/types/src/lib/getCollision.ts +0 -38
- package/packages/types/src/lib/getCollisions.test.ts +0 -82
- package/packages/types/src/lib/getCollisions.ts +0 -22
- package/packages/types/src/lib/getPlacedCell.ts +0 -9
- package/packages/types/src/lib/getWordThrough.ts +0 -30
- package/packages/types/src/lib/getWordsInRows.ts +0 -34
- package/packages/types/src/lib/index.ts +0 -5
- package/packages/types/src/lib/isSameBoardWord.ts +0 -5
- package/packages/types/src/lib/toBoardWord.ts +0 -12
- package/packages/types/src/lib/transpose.ts +0 -15
- package/packages/types/src/type-guards/index.ts +0 -10
- package/packages/types/src/type-guards/isBingo.ts +0 -8
- package/packages/types/src/type-guards/isBoardJson.test.ts +0 -33
- package/packages/types/src/type-guards/isBoardJson.ts +0 -23
- package/packages/types/src/type-guards/isCellJson.ts +0 -14
- package/packages/types/src/type-guards/isError.ts +0 -9
- package/packages/types/src/type-guards/isGame.ts +0 -5
- package/packages/types/src/type-guards/isLocale.ts +0 -5
- package/packages/types/src/type-guards/isMultiplierBingo.ts +0 -7
- package/packages/types/src/type-guards/isObject.ts +0 -3
- package/packages/types/src/type-guards/isScoreBingo.ts +0 -7
- package/packages/types/src/type-guards/isTileJson.ts +0 -7
- package/packages/types/tsconfig.json +0 -10
- package/packages/word-definitions/README.md +0 -3
- package/packages/word-definitions/build/crawl.d.ts +0 -2
- package/packages/word-definitions/build/crawl.js +0 -20
- package/packages/word-definitions/build/getWordDefinition.d.ts +0 -2
- package/packages/word-definitions/build/getWordDefinition.js +0 -13
- package/packages/word-definitions/build/index.d.ts +0 -5
- package/packages/word-definitions/build/index.js +0 -21
- package/packages/word-definitions/build/languages/english.d.ts +0 -3
- package/packages/word-definitions/build/languages/english.js +0 -38
- package/packages/word-definitions/build/languages/french.d.ts +0 -3
- package/packages/word-definitions/build/languages/french.js +0 -22
- package/packages/word-definitions/build/languages/german.d.ts +0 -3
- package/packages/word-definitions/build/languages/german.js +0 -70
- package/packages/word-definitions/build/languages/index.d.ts +0 -8
- package/packages/word-definitions/build/languages/index.js +0 -44
- package/packages/word-definitions/build/languages/persian.d.ts +0 -3
- package/packages/word-definitions/build/languages/persian.js +0 -23
- package/packages/word-definitions/build/languages/polish.d.ts +0 -3
- package/packages/word-definitions/build/languages/polish.js +0 -24
- package/packages/word-definitions/build/languages/romanian.d.ts +0 -3
- package/packages/word-definitions/build/languages/romanian.js +0 -26
- package/packages/word-definitions/build/languages/spanish.d.ts +0 -3
- package/packages/word-definitions/build/languages/spanish.js +0 -39
- package/packages/word-definitions/build/languages/turkish.d.ts +0 -3
- package/packages/word-definitions/build/languages/turkish.js +0 -31
- package/packages/word-definitions/build/lib/index.d.ts +0 -3
- package/packages/word-definitions/build/lib/index.js +0 -9
- package/packages/word-definitions/build/lib/normalizeDefinition.d.ts +0 -1
- package/packages/word-definitions/build/lib/normalizeDefinition.js +0 -46
- package/packages/word-definitions/build/lib/request.d.ts +0 -6
- package/packages/word-definitions/build/lib/request.js +0 -28
- package/packages/word-definitions/build/lib/unique.d.ts +0 -1
- package/packages/word-definitions/build/lib/unique.js +0 -5
- package/packages/word-definitions/build/parse.d.ts +0 -3
- package/packages/word-definitions/build/parse.js +0 -25
- package/packages/word-definitions/build/types.d.ts +0 -4
- package/packages/word-definitions/build/types.js +0 -2
- package/packages/word-definitions/package.json +0 -43
- package/packages/word-definitions/src/__tests__/expected/de-DE.hm.json +0 -4
- package/packages/word-definitions/src/__tests__/expected/de-DE.ho.json +0 -9
- package/packages/word-definitions/src/__tests__/expected/de-DE.kolla.json +0 -4
- package/packages/word-definitions/src/__tests__/expected/de-DE.vom.json +0 -16
- package/packages/word-definitions/src/__tests__/expected/en-US.awe.json +0 -12
- package/packages/word-definitions/src/__tests__/expected/en-US.oe.json +0 -7
- package/packages/word-definitions/src/__tests__/expected/en-US.pawn.json +0 -16
- package/packages/word-definitions/src/__tests__/expected/en-US.pawnee.json +0 -6
- package/packages/word-definitions/src/__tests__/expected/en-US.pean.json +0 -9
- package/packages/word-definitions/src/__tests__/expected/en-US.wiz.json +0 -10
- package/packages/word-definitions/src/__tests__/expected/en-US.zzzzqq.json +0 -4
- package/packages/word-definitions/src/__tests__/expected/es-ES.corma.json +0 -7
- package/packages/word-definitions/src/__tests__/expected/es-ES.portero.json +0 -9
- package/packages/word-definitions/src/__tests__/expected/ro-RO.aciua.json +0 -7
- package/packages/word-definitions/src/__tests__/expected/tr-TR.lojik.json +0 -4
- package/packages/word-definitions/src/__tests__/input/de-DE.hm.html +0 -873
- package/packages/word-definitions/src/__tests__/input/de-DE.ho.html +0 -1144
- package/packages/word-definitions/src/__tests__/input/de-DE.kolla.html +0 -980
- package/packages/word-definitions/src/__tests__/input/de-DE.vom.html +0 -738
- package/packages/word-definitions/src/__tests__/input/en-US.awe.json +0 -1
- package/packages/word-definitions/src/__tests__/input/en-US.oe.json +0 -1
- package/packages/word-definitions/src/__tests__/input/en-US.pawn.json +0 -1
- package/packages/word-definitions/src/__tests__/input/en-US.pawnee.json +0 -1
- package/packages/word-definitions/src/__tests__/input/en-US.pean.json +0 -1
- package/packages/word-definitions/src/__tests__/input/en-US.wiz.json +0 -1
- package/packages/word-definitions/src/__tests__/input/en-US.zzzzqq.json +0 -1
- package/packages/word-definitions/src/__tests__/input/es-ES.corma.html +0 -762
- package/packages/word-definitions/src/__tests__/input/es-ES.portero.html +0 -764
- package/packages/word-definitions/src/__tests__/input/ro-RO.aciua.html +0 -31
- package/packages/word-definitions/src/__tests__/input/tr-TR.lojik.html +0 -1
- package/packages/word-definitions/src/crawl.ts +0 -19
- package/packages/word-definitions/src/getWordDefinition.ts +0 -11
- package/packages/word-definitions/src/index.ts +0 -5
- package/packages/word-definitions/src/languages/english.ts +0 -53
- package/packages/word-definitions/src/languages/french.ts +0 -22
- package/packages/word-definitions/src/languages/german.ts +0 -88
- package/packages/word-definitions/src/languages/index.ts +0 -8
- package/packages/word-definitions/src/languages/persian.ts +0 -24
- package/packages/word-definitions/src/languages/polish.ts +0 -24
- package/packages/word-definitions/src/languages/romanian.ts +0 -27
- package/packages/word-definitions/src/languages/spanish.ts +0 -42
- package/packages/word-definitions/src/languages/turkish.ts +0 -32
- package/packages/word-definitions/src/lib/index.ts +0 -3
- package/packages/word-definitions/src/lib/normalizeDefinition.ts +0 -53
- package/packages/word-definitions/src/lib/request.ts +0 -30
- package/packages/word-definitions/src/lib/unique.ts +0 -1
- package/packages/word-definitions/src/parse.test.ts +0 -41
- package/packages/word-definitions/src/parse.ts +0 -26
- package/packages/word-definitions/src/types.ts +0 -4
- package/packages/word-definitions/tsconfig.json +0 -10
- package/packages/word-lists/README.md +0 -3
- package/packages/word-lists/build/getWordList.d.ts +0 -2
- package/packages/word-lists/build/getWordList.js +0 -18
- package/packages/word-lists/build/index.d.ts +0 -3
- package/packages/word-lists/build/index.js +0 -21
- package/packages/word-lists/build/languages/english.d.ts +0 -2
- package/packages/word-lists/build/languages/english.js +0 -15
- package/packages/word-lists/build/languages/french.d.ts +0 -1
- package/packages/word-lists/build/languages/french.js +0 -11
- package/packages/word-lists/build/languages/german.d.ts +0 -1
- package/packages/word-lists/build/languages/german.js +0 -10
- package/packages/word-lists/build/languages/index.d.ts +0 -8
- package/packages/word-lists/build/languages/index.js +0 -44
- package/packages/word-lists/build/languages/persian.d.ts +0 -1
- package/packages/word-lists/build/languages/persian.js +0 -10
- package/packages/word-lists/build/languages/polish.d.ts +0 -1
- package/packages/word-lists/build/languages/polish.js +0 -56
- package/packages/word-lists/build/languages/romanian.d.ts +0 -1
- package/packages/word-lists/build/languages/romanian.js +0 -11
- package/packages/word-lists/build/languages/spanish.d.ts +0 -1
- package/packages/word-lists/build/languages/spanish.js +0 -11
- package/packages/word-lists/build/languages/turkish.d.ts +0 -1
- package/packages/word-lists/build/languages/turkish.js +0 -10
- package/packages/word-lists/build/lib/downloadFile.d.ts +0 -1
- package/packages/word-lists/build/lib/downloadFile.js +0 -38
- package/packages/word-lists/build/lib/downloadHtml.d.ts +0 -1
- package/packages/word-lists/build/lib/downloadHtml.js +0 -21
- package/packages/word-lists/build/lib/extractWords.d.ts +0 -1
- package/packages/word-lists/build/lib/extractWords.js +0 -17
- package/packages/word-lists/build/lib/findFirstWordIndex.d.ts +0 -1
- package/packages/word-lists/build/lib/findFirstWordIndex.js +0 -17
- package/packages/word-lists/build/lib/getHash.d.ts +0 -1
- package/packages/word-lists/build/lib/getHash.js +0 -9
- package/packages/word-lists/build/lib/getTempFilepath.d.ts +0 -1
- package/packages/word-lists/build/lib/getTempFilepath.js +0 -15
- package/packages/word-lists/build/lib/getTxtWordList.d.ts +0 -1
- package/packages/word-lists/build/lib/getTxtWordList.js +0 -17
- package/packages/word-lists/build/lib/index.d.ts +0 -10
- package/packages/word-lists/build/lib/index.js +0 -23
- package/packages/word-lists/build/lib/transliterateDiacritics.d.ts +0 -2
- package/packages/word-lists/build/lib/transliterateDiacritics.js +0 -9
- package/packages/word-lists/build/lib/unique.d.ts +0 -1
- package/packages/word-lists/build/lib/unique.js +0 -5
- package/packages/word-lists/build/lib/unzip.d.ts +0 -1
- package/packages/word-lists/build/lib/unzip.js +0 -24
- package/packages/word-lists/package.json +0 -45
- package/packages/word-lists/src/getWordList.ts +0 -17
- package/packages/word-lists/src/index.ts +0 -3
- package/packages/word-lists/src/languages/english.ts +0 -16
- package/packages/word-lists/src/languages/french.ts +0 -11
- package/packages/word-lists/src/languages/german.ts +0 -10
- package/packages/word-lists/src/languages/index.ts +0 -8
- package/packages/word-lists/src/languages/persian.ts +0 -10
- package/packages/word-lists/src/languages/polish.ts +0 -59
- package/packages/word-lists/src/languages/romanian.ts +0 -10
- package/packages/word-lists/src/languages/spanish.ts +0 -10
- package/packages/word-lists/src/languages/turkish.ts +0 -9
- package/packages/word-lists/src/lib/downloadFile.ts +0 -37
- package/packages/word-lists/src/lib/downloadHtml.ts +0 -18
- package/packages/word-lists/src/lib/extractWords.ts +0 -17
- package/packages/word-lists/src/lib/findFirstWordIndex.ts +0 -16
- package/packages/word-lists/src/lib/getHash.ts +0 -3
- package/packages/word-lists/src/lib/getTempFilepath.ts +0 -11
- package/packages/word-lists/src/lib/getTxtWordList.ts +0 -12
- package/packages/word-lists/src/lib/index.ts +0 -10
- package/packages/word-lists/src/lib/transliterateDiacritics.ts +0 -7
- package/packages/word-lists/src/lib/unique.ts +0 -1
- package/packages/word-lists/src/lib/unzip.ts +0 -18
- package/packages/word-lists/tsconfig.json +0 -10
- package/playwright.config.ts +0 -30
- package/project.json +0 -3
- package/screencast.gif +0 -0
- package/scripts/record-screencast.ts +0 -347
- package/tsconfig.json +0 -19
- /package/{packages/scrabble-solver/.env → .env} +0 -0
- /package/{packages/scrabble-solver/.next → .next}/dynamic-css-manifest.json +0 -0
- /package/{packages/scrabble-solver/.next → .next}/export-marker.json +0 -0
- /package/{packages/scrabble-solver/.next → .next}/images-manifest.json +0 -0
- /package/{packages/scrabble-solver/.next → .next}/package.json +0 -0
- /package/{packages/scrabble-solver/.next → .next}/required-server-files.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/required-server-files.json +0 -0
- /package/{packages/scrabble-solver/.next → .next}/server/chunks/30.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/server/chunks/546.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/server/chunks/671.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/server/chunks/853.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/server/chunks/968.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/server/dynamic-css-manifest.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/server/functions-config-manifest.json +0 -0
- /package/{packages/scrabble-solver/.next → .next}/server/interception-route-rewrite-manifest.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/server/middleware-manifest.json +0 -0
- /package/{packages/scrabble-solver/.next → .next}/server/next-font-manifest.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/server/next-font-manifest.json +0 -0
- /package/{packages/scrabble-solver/.next → .next}/server/pages/_app.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/server/pages/_error.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/server/pages/api/visit.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/server/pages/index.meta +0 -0
- /package/{packages/scrabble-solver/.next → .next}/server/prefetch-hints.json +0 -0
- /package/{packages/scrabble-solver/.next → .next}/server/webpack-runtime.js +0 -0
- /package/{packages/scrabble-solver/.next/static/iJDkHROLsX-5CEsv2p6sC → .next/static/Ng_NN9gQywZowmg2O0pgm}/_ssgManifest.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/static/chunks/277.6785dfaf22fdb0b7.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/static/chunks/341.79535ba85bf1986f.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/static/chunks/827.d01b6d69af340ba4.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/static/chunks/980.dd35e807b18063c1.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/static/chunks/990.61296e5870b91f11.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/static/chunks/framework-86d3b250d278cea9.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/static/chunks/main-738e097cd313908f.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/static/chunks/pages/_error-f0290a98eb3ed0ec.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/static/chunks/polyfills-42372ed130431b0a.js +0 -0
- /package/{packages/scrabble-solver/.next → .next}/static/css/2d03f0da2c678dfc.css +0 -0
- /package/{packages/scrabble-solver/.next → .next}/static/css/4dbcacc1122ac6b9.css +0 -0
- /package/{packages/scrabble-solver/.next → .next}/static/css/7b6724d2df70f48f.css +0 -0
- /package/{packages/scrabble-solver/.next → .next}/static/css/98051ed25076b896.css +0 -0
- /package/{packages/scrabble-solver/.next → .next}/static/css/b736be3bd02b5d99.css +0 -0
- /package/{packages/scrabble-solver/.next → .next}/static/css/ca311e6c030663d4.css +0 -0
- /package/{packages/scrabble-solver/.next → .next}/static/css/cd4d7f2458487399.css +0 -0
- /package/{packages/scrabble-solver/.next → .next}/static/css/dee878eb64099d92.css +0 -0
- /package/{packages/scrabble-solver/public → public}/favicon.ico +0 -0
- /package/{packages/scrabble-solver/public → public}/icons/apple-touch-icon-114x114.png +0 -0
- /package/{packages/scrabble-solver/public → public}/icons/apple-touch-icon-120x120.png +0 -0
- /package/{packages/scrabble-solver/public → public}/icons/apple-touch-icon-144x144.png +0 -0
- /package/{packages/scrabble-solver/public → public}/icons/apple-touch-icon-152x152.png +0 -0
- /package/{packages/scrabble-solver/public → public}/icons/apple-touch-icon-57x57.png +0 -0
- /package/{packages/scrabble-solver/public → public}/icons/apple-touch-icon-60x60.png +0 -0
- /package/{packages/scrabble-solver/public → public}/icons/apple-touch-icon-72x72.png +0 -0
- /package/{packages/scrabble-solver/public → public}/icons/apple-touch-icon-76x76.png +0 -0
- /package/{packages/scrabble-solver/public → public}/icons/favicon-128.png +0 -0
- /package/{packages/scrabble-solver/public → public}/icons/favicon-16x16.png +0 -0
- /package/{packages/scrabble-solver/public → public}/icons/favicon-196x196.png +0 -0
- /package/{packages/scrabble-solver/public → public}/icons/favicon-32x32.png +0 -0
- /package/{packages/scrabble-solver/public → public}/icons/favicon-96x96.png +0 -0
- /package/{packages/scrabble-solver/public → public}/icons/favicon.svg +0 -0
- /package/{packages/scrabble-solver/public → public}/icons/mstile-144x144.png +0 -0
- /package/{packages/scrabble-solver/public → public}/icons/mstile-150x150.png +0 -0
- /package/{packages/scrabble-solver/public → public}/icons/mstile-310x150.png +0 -0
- /package/{packages/scrabble-solver/public → public}/icons/mstile-310x310.png +0 -0
- /package/{packages/scrabble-solver/public → public}/icons/mstile-70x70.png +0 -0
- /package/{packages/scrabble-solver/public → public}/logo.svg +0 -0
- /package/{packages/scrabble-solver/public → public}/og.png +0 -0
- /package/{packages/scrabble-solver/public → public}/robots.txt +0 -0
- /package/{packages/scrabble-solver/public → public}/site.webmanifest +0 -0
- /package/{packages/scrabble-solver/public → public}/sitemap.xml +0 -0
|
@@ -1,1009 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-lines */
|
|
2
|
-
|
|
3
|
-
import { Gaddag } from '@kamilmielnik/gaddag';
|
|
4
|
-
import { getConfig } from '@scrabble-solver/configs';
|
|
5
|
-
import { BONUS_CHARACTER, BONUS_WORD } from '@scrabble-solver/constants';
|
|
6
|
-
import {
|
|
7
|
-
type ConfigJson,
|
|
8
|
-
type ResultJson,
|
|
9
|
-
Board,
|
|
10
|
-
Cell,
|
|
11
|
-
Config,
|
|
12
|
-
Game,
|
|
13
|
-
Locale,
|
|
14
|
-
Result,
|
|
15
|
-
Tile,
|
|
16
|
-
} from '@scrabble-solver/types';
|
|
17
|
-
|
|
18
|
-
import { MoveGenerator } from './MoveGenerator';
|
|
19
|
-
import { ReferenceSolver } from './ReferenceSolver';
|
|
20
|
-
|
|
21
|
-
type TileScores = Record<string, number>;
|
|
22
|
-
|
|
23
|
-
type BoardTilePlacement = [x: number, y: number, character: string, isBlank?: boolean];
|
|
24
|
-
|
|
25
|
-
type PlacedTile = [x: number, y: number, character: string, isBlank: boolean];
|
|
26
|
-
|
|
27
|
-
interface MoveSummary {
|
|
28
|
-
placed: PlacedTile[];
|
|
29
|
-
points: number;
|
|
30
|
-
words: string[];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const BLANK_CHARACTER = '?';
|
|
34
|
-
|
|
35
|
-
const BASIC_TILES: TileScores = { a: 1, b: 3, c: 3, d: 2 };
|
|
36
|
-
|
|
37
|
-
const SPANISH_MINI_TILES: TileScores = { a: 1, c: 3, ch: 5, h: 4, i: 1, l: 1, ll: 8, o: 1 };
|
|
38
|
-
|
|
39
|
-
describe('MoveGenerator - input validation', () => {
|
|
40
|
-
const gaddag = Gaddag.fromArray(['ab']);
|
|
41
|
-
|
|
42
|
-
it('throws when the alphabet exceeds 64 tiles', () => {
|
|
43
|
-
const config = createConfig(createWideAlphabet(65));
|
|
44
|
-
expect(() => new MoveGenerator(gaddag, config, createBoard(5, 5), createRack(['a']))).toThrow(
|
|
45
|
-
'Alphabets larger than 64 tiles are not supported',
|
|
46
|
-
);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('accepts an alphabet of exactly 64 tiles', () => {
|
|
50
|
-
const config = createConfig(createWideAlphabet(64));
|
|
51
|
-
const results = generate(gaddag, config, createBoard(5, 5), ['a', 'b']);
|
|
52
|
-
expect(results.length).toBe(4);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('throws when the board is wider than 32 cells', () => {
|
|
56
|
-
const config = createConfig(BASIC_TILES);
|
|
57
|
-
expect(() => new MoveGenerator(gaddag, config, createBoard(33, 5), createRack(['a']))).toThrow(
|
|
58
|
-
'Boards larger than 32x32 are not supported',
|
|
59
|
-
);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it('throws when the board is taller than 32 cells', () => {
|
|
63
|
-
const config = createConfig(BASIC_TILES);
|
|
64
|
-
expect(() => new MoveGenerator(gaddag, config, createBoard(5, 33), createRack(['a']))).toThrow(
|
|
65
|
-
'Boards larger than 32x32 are not supported',
|
|
66
|
-
);
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
it('accepts a 32x32 board', () => {
|
|
70
|
-
const config = createConfig(BASIC_TILES);
|
|
71
|
-
const results = generate(gaddag, config, createBoard(32, 32), ['a', 'b']);
|
|
72
|
-
expect(results.length).toBe(4);
|
|
73
|
-
expect(results.every((result) => coversCell(result, 16, 16))).toBe(true);
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
describe('MoveGenerator - rack edge cases', () => {
|
|
78
|
-
const gaddag = Gaddag.fromArray(['ab']);
|
|
79
|
-
const config = createConfig(BASIC_TILES);
|
|
80
|
-
const board = createBoard(5, 5, [[2, 2, 'a']]);
|
|
81
|
-
|
|
82
|
-
it('returns nothing for an empty rack', () => {
|
|
83
|
-
expect(generate(gaddag, config, board, [])).toEqual([]);
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
it('returns nothing when the rack has only characters outside the config alphabet', () => {
|
|
87
|
-
expect(generate(gaddag, config, board, ['x'])).toEqual([]);
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it('ignores rack tiles with characters outside the config alphabet', () => {
|
|
91
|
-
expect(generate(gaddag, config, board, ['b', 'x'])).toEqual(generate(gaddag, config, board, ['b']));
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it('returns nothing when rack characters do not occur in the dictionary', () => {
|
|
95
|
-
const configWithZ = createConfig({ ...BASIC_TILES, z: 10 });
|
|
96
|
-
expect(generate(gaddag, configWithZ, board, ['z'])).toEqual([]);
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
describe('MoveGenerator - first move on an empty board', () => {
|
|
101
|
-
it('generates every word placement through the center, in both directions', () => {
|
|
102
|
-
const gaddag = Gaddag.fromArray(['ab', 'ba']);
|
|
103
|
-
const config = createConfig(BASIC_TILES);
|
|
104
|
-
const results = generate(gaddag, config, createBoard(5, 5), ['a', 'b']);
|
|
105
|
-
expect(summarizeAll(results)).toEqual([
|
|
106
|
-
{
|
|
107
|
-
placed: [
|
|
108
|
-
[1, 2, 'a', false],
|
|
109
|
-
[2, 2, 'b', false],
|
|
110
|
-
],
|
|
111
|
-
points: 4,
|
|
112
|
-
words: ['ab'],
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
placed: [
|
|
116
|
-
[1, 2, 'b', false],
|
|
117
|
-
[2, 2, 'a', false],
|
|
118
|
-
],
|
|
119
|
-
points: 4,
|
|
120
|
-
words: ['ba'],
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
placed: [
|
|
124
|
-
[2, 2, 'a', false],
|
|
125
|
-
[3, 2, 'b', false],
|
|
126
|
-
],
|
|
127
|
-
points: 4,
|
|
128
|
-
words: ['ab'],
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
placed: [
|
|
132
|
-
[2, 2, 'b', false],
|
|
133
|
-
[3, 2, 'a', false],
|
|
134
|
-
],
|
|
135
|
-
points: 4,
|
|
136
|
-
words: ['ba'],
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
placed: [
|
|
140
|
-
[2, 1, 'a', false],
|
|
141
|
-
[2, 2, 'b', false],
|
|
142
|
-
],
|
|
143
|
-
points: 4,
|
|
144
|
-
words: ['ab'],
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
placed: [
|
|
148
|
-
[2, 1, 'b', false],
|
|
149
|
-
[2, 2, 'a', false],
|
|
150
|
-
],
|
|
151
|
-
points: 4,
|
|
152
|
-
words: ['ba'],
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
placed: [
|
|
156
|
-
[2, 2, 'a', false],
|
|
157
|
-
[2, 3, 'b', false],
|
|
158
|
-
],
|
|
159
|
-
points: 4,
|
|
160
|
-
words: ['ab'],
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
placed: [
|
|
164
|
-
[2, 2, 'b', false],
|
|
165
|
-
[2, 3, 'a', false],
|
|
166
|
-
],
|
|
167
|
-
points: 4,
|
|
168
|
-
words: ['ba'],
|
|
169
|
-
},
|
|
170
|
-
]);
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
it('starts from the center of rectangular boards', () => {
|
|
174
|
-
const gaddag = Gaddag.fromArray(['ab']);
|
|
175
|
-
const config = createConfig(BASIC_TILES);
|
|
176
|
-
const wideResults = generate(gaddag, config, createBoard(9, 5), ['a', 'b']);
|
|
177
|
-
expect(wideResults.length).toBe(4);
|
|
178
|
-
expect(wideResults.every((result) => coversCell(result, 4, 2))).toBe(true);
|
|
179
|
-
const tallResults = generate(gaddag, config, createBoard(5, 9), ['a', 'b']);
|
|
180
|
-
expect(tallResults.length).toBe(4);
|
|
181
|
-
expect(tallResults.every((result) => coversCell(result, 2, 4))).toBe(true);
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
it('respects the rack multiset', () => {
|
|
185
|
-
const gaddag = Gaddag.fromArray(['aa']);
|
|
186
|
-
const config = createConfig(BASIC_TILES);
|
|
187
|
-
expect(generate(gaddag, config, createBoard(5, 5), ['a'])).toEqual([]);
|
|
188
|
-
expect(generate(gaddag, config, createBoard(5, 5), ['a', 'a']).length).toBe(4);
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
it('substitutes missing tiles with a blank', () => {
|
|
192
|
-
const gaddag = Gaddag.fromArray(['aa']);
|
|
193
|
-
const config = createConfig(BASIC_TILES);
|
|
194
|
-
const results = generate(gaddag, config, createBoard(5, 5), ['a', BLANK_CHARACTER]);
|
|
195
|
-
expect(results.length).toBe(8);
|
|
196
|
-
expect(results.every((result) => result.points === 1)).toBe(true);
|
|
197
|
-
expect(results.every((result) => result.blanksCount === 1)).toBe(true);
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
it('does not generate one-letter words', () => {
|
|
201
|
-
const gaddag = Gaddag.fromArray(['a', 'ab']);
|
|
202
|
-
const config = createConfig(BASIC_TILES);
|
|
203
|
-
expect(generate(gaddag, config, createBoard(5, 5), ['a'])).toEqual([]);
|
|
204
|
-
});
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
describe('MoveGenerator - anchoring and connectivity', () => {
|
|
208
|
-
it('requires contact with existing tiles', () => {
|
|
209
|
-
const config = createConfig(BASIC_TILES);
|
|
210
|
-
const board = createBoard(5, 5, [[0, 0, 'a']]);
|
|
211
|
-
expect(generate(Gaddag.fromArray(['bc']), config, board, ['b', 'c'])).toEqual([]);
|
|
212
|
-
expect(generate(Gaddag.fromArray(['abc']), config, board, ['b', 'c']).length).toBe(2);
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
it('extends existing words on either side and on both at once', () => {
|
|
216
|
-
const gaddag = Gaddag.fromArray(['dab', 'abe', 'dabe']);
|
|
217
|
-
const config = createConfig({ a: 1, b: 3, d: 2, e: 1 });
|
|
218
|
-
const board = createBoard(5, 5, [
|
|
219
|
-
[1, 2, 'a'],
|
|
220
|
-
[2, 2, 'b'],
|
|
221
|
-
]);
|
|
222
|
-
const results = generate(gaddag, config, board, ['d', 'e']);
|
|
223
|
-
expect(toWords(results)).toEqual(['dab', 'dabe', 'abe']);
|
|
224
|
-
expect(results.map((result) => result.points)).toEqual([6, 7, 5]);
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
it('plays through existing tiles', () => {
|
|
228
|
-
const gaddag = Gaddag.fromArray(['abc']);
|
|
229
|
-
const config = createConfig(BASIC_TILES);
|
|
230
|
-
const board = createBoard(5, 5, [
|
|
231
|
-
[1, 2, 'a'],
|
|
232
|
-
[3, 2, 'c'],
|
|
233
|
-
]);
|
|
234
|
-
const results = generateJson(gaddag, config, board, ['b']);
|
|
235
|
-
expect(results).toEqual([{ blankIndices: [], id: 0, isHorizontal: true, points: 7, tiles: ['b'], x: 1, y: 2 }]);
|
|
236
|
-
const [result] = results.map((json) => Result.fromJson(json, board));
|
|
237
|
-
expect(result.word).toBe('abc');
|
|
238
|
-
expect(result.cells.map(({ isEmpty, x, y }) => ({ isEmpty, x, y }))).toEqual([
|
|
239
|
-
{ isEmpty: false, x: 1, y: 2 },
|
|
240
|
-
{ isEmpty: true, x: 2, y: 2 },
|
|
241
|
-
{ isEmpty: false, x: 3, y: 2 },
|
|
242
|
-
]);
|
|
243
|
-
expect(result.collisions).toEqual([]);
|
|
244
|
-
});
|
|
245
|
-
|
|
246
|
-
it('returns nothing on a full board', () => {
|
|
247
|
-
const gaddag = Gaddag.fromArray(['ab']);
|
|
248
|
-
const config = createConfig(BASIC_TILES);
|
|
249
|
-
const placements: BoardTilePlacement[] = [];
|
|
250
|
-
|
|
251
|
-
for (let y = 0; y < 3; ++y) {
|
|
252
|
-
for (let x = 0; x < 3; ++x) {
|
|
253
|
-
placements.push([x, y, 'a']);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
expect(generate(gaddag, config, createBoard(3, 3, placements), ['b'])).toEqual([]);
|
|
258
|
-
});
|
|
259
|
-
|
|
260
|
-
it('generates nothing around board characters missing from the dictionary', () => {
|
|
261
|
-
const gaddag = Gaddag.fromArray(['ab']);
|
|
262
|
-
const config = createConfig(BASIC_TILES);
|
|
263
|
-
const board = createBoard(5, 5, [[2, 2, 'z']]);
|
|
264
|
-
expect(generate(gaddag, config, board, ['a', 'b'])).toEqual([]);
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
it('treats candidate cells (empty cells holding a tile) as empty', () => {
|
|
268
|
-
const gaddag = Gaddag.fromArray(['ab']);
|
|
269
|
-
const config = createConfig(BASIC_TILES);
|
|
270
|
-
const board = Board.create(5, 5);
|
|
271
|
-
board.updateCell(2, 2, () => new Cell({ isEmpty: true, tile: new Tile({ character: 'a' }), x: 2, y: 2 }));
|
|
272
|
-
expect(generate(gaddag, config, board, ['a', 'b'])).toEqual(
|
|
273
|
-
generate(gaddag, config, Board.create(5, 5), ['a', 'b']),
|
|
274
|
-
);
|
|
275
|
-
});
|
|
276
|
-
});
|
|
277
|
-
|
|
278
|
-
describe('MoveGenerator - perpendicular words (cross-checks)', () => {
|
|
279
|
-
it('rejects placements whose perpendicular word is not in the dictionary', () => {
|
|
280
|
-
const gaddag = Gaddag.fromArray(['bb']);
|
|
281
|
-
const config = createConfig(BASIC_TILES);
|
|
282
|
-
const board = createBoard(5, 5, [[2, 1, 'a']]);
|
|
283
|
-
expect(generate(gaddag, config, board, ['b', 'b'])).toEqual([]);
|
|
284
|
-
});
|
|
285
|
-
|
|
286
|
-
it('validates the perpendicular word at every placed tile', () => {
|
|
287
|
-
const gaddag = Gaddag.fromArray(['bb', 'ab']);
|
|
288
|
-
const config = createConfig(BASIC_TILES);
|
|
289
|
-
const board = createBoard(5, 5, [
|
|
290
|
-
[1, 1, 'a'],
|
|
291
|
-
[2, 1, 'a'],
|
|
292
|
-
]);
|
|
293
|
-
const results = generate(gaddag, config, board, ['b', 'b']);
|
|
294
|
-
expect(toSortedPoints(results)).toEqual([4, 4, 10, 10, 14]);
|
|
295
|
-
expect(summarizeAll(results)).toContainEqual({
|
|
296
|
-
placed: [
|
|
297
|
-
[1, 2, 'b', false],
|
|
298
|
-
[2, 2, 'b', false],
|
|
299
|
-
],
|
|
300
|
-
points: 14,
|
|
301
|
-
words: ['bb', 'ab', 'ab'],
|
|
302
|
-
});
|
|
303
|
-
});
|
|
304
|
-
|
|
305
|
-
it('applies cross-check masks to tiles beyond the 32nd alphabet entry', () => {
|
|
306
|
-
const tileScores = createWideAlphabet(40);
|
|
307
|
-
const alphabet = Object.keys(tileScores);
|
|
308
|
-
const high = alphabet[35];
|
|
309
|
-
const other = alphabet[36];
|
|
310
|
-
const gaddag = Gaddag.fromArray([`a${high}`, `b${high}`, `a${other}`]);
|
|
311
|
-
const config = createConfig(tileScores);
|
|
312
|
-
const board = createBoard(5, 5, [
|
|
313
|
-
[1, 2, 'a'],
|
|
314
|
-
[2, 1, 'b'],
|
|
315
|
-
]);
|
|
316
|
-
const results = generate(gaddag, config, board, [high, other]);
|
|
317
|
-
expect(summarizeAll(results)).toEqual([
|
|
318
|
-
{ placed: [[3, 1, high, false]], points: 4, words: [`b${high}`] },
|
|
319
|
-
{ placed: [[2, 2, high, false]], points: 6, words: [`a${high}`, `b${high}`] },
|
|
320
|
-
{ placed: [[1, 3, high, false]], points: 2, words: [`a${high}`] },
|
|
321
|
-
{ placed: [[1, 3, other, false]], points: 2, words: [`a${other}`] },
|
|
322
|
-
]);
|
|
323
|
-
});
|
|
324
|
-
|
|
325
|
-
it('reads perpendicular tiles on both sides of the placed tile', () => {
|
|
326
|
-
const gaddag = Gaddag.fromArray(['abc', 'bd']);
|
|
327
|
-
const config = createConfig(BASIC_TILES);
|
|
328
|
-
const board = createBoard(5, 5, [
|
|
329
|
-
[2, 1, 'a'],
|
|
330
|
-
[2, 3, 'c'],
|
|
331
|
-
[3, 2, 'd'],
|
|
332
|
-
]);
|
|
333
|
-
const results = generateJson(gaddag, config, board, ['b']);
|
|
334
|
-
expect(results).toEqual([{ blankIndices: [], id: 0, isHorizontal: true, points: 12, tiles: ['b'], x: 2, y: 2 }]);
|
|
335
|
-
const [result] = results.map((json) => Result.fromJson(json, board));
|
|
336
|
-
expect(result.words).toEqual(['bd', 'abc']);
|
|
337
|
-
expect(result.collisions).toHaveLength(1);
|
|
338
|
-
expect(result.collisions[0].map(({ x, y }) => ({ x, y }))).toEqual([
|
|
339
|
-
{ x: 2, y: 1 },
|
|
340
|
-
{ x: 2, y: 2 },
|
|
341
|
-
{ x: 2, y: 3 },
|
|
342
|
-
]);
|
|
343
|
-
});
|
|
344
|
-
});
|
|
345
|
-
|
|
346
|
-
describe('MoveGenerator - single-tile moves', () => {
|
|
347
|
-
const gaddag = Gaddag.fromArray(['aba']);
|
|
348
|
-
const config = createConfig(BASIC_TILES);
|
|
349
|
-
const crossroads = () =>
|
|
350
|
-
createBoard(5, 5, [
|
|
351
|
-
[1, 2, 'a'],
|
|
352
|
-
[3, 2, 'a'],
|
|
353
|
-
[2, 1, 'a'],
|
|
354
|
-
[2, 3, 'a'],
|
|
355
|
-
]);
|
|
356
|
-
|
|
357
|
-
it('emits one result when a tile completes words in both directions', () => {
|
|
358
|
-
const results = generate(gaddag, config, crossroads(), ['b']);
|
|
359
|
-
expect(summarizeAll(results)).toEqual([{ placed: [[2, 2, 'b', false]], points: 10, words: ['aba', 'aba'] }]);
|
|
360
|
-
expect(results[0].cells.every((cell) => cell.y === 2)).toBe(true);
|
|
361
|
-
});
|
|
362
|
-
|
|
363
|
-
it('keeps blank and real-tile versions of the same placement distinct', () => {
|
|
364
|
-
const results = generate(gaddag, config, crossroads(), ['b', BLANK_CHARACTER]);
|
|
365
|
-
expect(summarizeAll(results)).toEqual([
|
|
366
|
-
{ placed: [[2, 2, 'b', false]], points: 10, words: ['aba', 'aba'] },
|
|
367
|
-
{ placed: [[2, 2, 'b', true]], points: 4, words: ['aba', 'aba'] },
|
|
368
|
-
]);
|
|
369
|
-
});
|
|
370
|
-
});
|
|
371
|
-
|
|
372
|
-
describe('MoveGenerator - blanks', () => {
|
|
373
|
-
it('scores blanks with blankScore in both the main and perpendicular word', () => {
|
|
374
|
-
const gaddag = Gaddag.fromArray(['ab']);
|
|
375
|
-
const config = createConfig(BASIC_TILES, { blankScore: 2 });
|
|
376
|
-
const board = createBoard(5, 5, [
|
|
377
|
-
[2, 1, 'a'],
|
|
378
|
-
[1, 2, 'a'],
|
|
379
|
-
]);
|
|
380
|
-
const results = generate(gaddag, config, board, [BLANK_CHARACTER]);
|
|
381
|
-
expect(summarizeAll(results)).toEqual([
|
|
382
|
-
{ placed: [[3, 1, 'b', true]], points: 3, words: ['ab'] },
|
|
383
|
-
{ placed: [[2, 2, 'b', true]], points: 6, words: ['ab', 'ab'] },
|
|
384
|
-
{ placed: [[1, 3, 'b', true]], points: 3, words: ['ab'] },
|
|
385
|
-
]);
|
|
386
|
-
});
|
|
387
|
-
|
|
388
|
-
it('scores blanks already on the board with blankScore', () => {
|
|
389
|
-
const gaddag = Gaddag.fromArray(['ab']);
|
|
390
|
-
const config = createConfig(BASIC_TILES);
|
|
391
|
-
const board = createBoard(5, 5, [[2, 2, 'a', true]]);
|
|
392
|
-
const results = generate(gaddag, config, board, ['b']);
|
|
393
|
-
expect(results.map((result) => result.points)).toEqual([3, 3]);
|
|
394
|
-
expect(results[0].cells[0]).toEqual(
|
|
395
|
-
new Cell({ isEmpty: false, tile: new Tile({ character: 'a', isBlank: true }), x: 2, y: 2 }),
|
|
396
|
-
);
|
|
397
|
-
});
|
|
398
|
-
|
|
399
|
-
it('plays multiple blanks in a single move', () => {
|
|
400
|
-
const gaddag = Gaddag.fromArray(['bb']);
|
|
401
|
-
const config = createConfig(BASIC_TILES);
|
|
402
|
-
const results = generate(gaddag, config, createBoard(5, 5), [BLANK_CHARACTER, BLANK_CHARACTER]);
|
|
403
|
-
expect(results.length).toBe(4);
|
|
404
|
-
expect(results.every((result) => result.points === 0)).toBe(true);
|
|
405
|
-
expect(results.every((result) => result.blanksCount === 2)).toBe(true);
|
|
406
|
-
});
|
|
407
|
-
});
|
|
408
|
-
|
|
409
|
-
describe('MoveGenerator - digraphs', () => {
|
|
410
|
-
const config = createConfig(SPANISH_MINI_TILES);
|
|
411
|
-
|
|
412
|
-
it('plays a digraph tile within words in both directions', () => {
|
|
413
|
-
const gaddag = Gaddag.fromArray(['chico']);
|
|
414
|
-
const results = generate(gaddag, config, createBoard(7, 7), ['ch', 'i', 'c', 'o']);
|
|
415
|
-
expect(results.length).toBe(8);
|
|
416
|
-
expect(toWords(results).every((word) => word === 'chico')).toBe(true);
|
|
417
|
-
expect(results.every((result) => result.points === 10)).toBe(true);
|
|
418
|
-
expect(results.every((result) => result.cells.length === 4)).toBe(true);
|
|
419
|
-
});
|
|
420
|
-
|
|
421
|
-
it('does not compose a digraph from two single tiles', () => {
|
|
422
|
-
const gaddag = Gaddag.fromArray(['chico']);
|
|
423
|
-
expect(generate(gaddag, config, createBoard(7, 7), ['c', 'h', 'i', 'c', 'o'])).toEqual([]);
|
|
424
|
-
});
|
|
425
|
-
|
|
426
|
-
it('does not compose a digraph from a board tile and a placed tile', () => {
|
|
427
|
-
const gaddag = Gaddag.fromArray(['chico']);
|
|
428
|
-
const board = createBoard(7, 7, [[2, 2, 'c']]);
|
|
429
|
-
expect(generate(gaddag, config, board, ['h', 'i', 'c', 'o'])).toEqual([]);
|
|
430
|
-
});
|
|
431
|
-
|
|
432
|
-
it('reads a board digraph tile when extending to the right', () => {
|
|
433
|
-
const gaddag = Gaddag.fromArray(['chico']);
|
|
434
|
-
const board = createBoard(7, 7, [
|
|
435
|
-
[1, 3, 'ch'],
|
|
436
|
-
[2, 3, 'i'],
|
|
437
|
-
[3, 3, 'c'],
|
|
438
|
-
]);
|
|
439
|
-
const results = generate(gaddag, config, board, ['o']);
|
|
440
|
-
expect(summarizeAll(results)).toEqual([{ placed: [[4, 3, 'o', false]], points: 10, words: ['chico'] }]);
|
|
441
|
-
});
|
|
442
|
-
|
|
443
|
-
it('reads a board digraph tile when extending to the left', () => {
|
|
444
|
-
const gaddag = Gaddag.fromArray(['chico']);
|
|
445
|
-
const board = createBoard(7, 7, [
|
|
446
|
-
[3, 3, 'i'],
|
|
447
|
-
[4, 3, 'c'],
|
|
448
|
-
[5, 3, 'o'],
|
|
449
|
-
]);
|
|
450
|
-
const results = generate(gaddag, config, board, ['ch']);
|
|
451
|
-
expect(summarizeAll(results)).toEqual([{ placed: [[2, 3, 'ch', false]], points: 10, words: ['chico'] }]);
|
|
452
|
-
});
|
|
453
|
-
|
|
454
|
-
it('validates perpendicular words through a board digraph tile', () => {
|
|
455
|
-
const gaddag = Gaddag.fromArray(['cho', 'ol']);
|
|
456
|
-
const board = createBoard(7, 7, [[3, 2, 'ch']]);
|
|
457
|
-
const results = generate(gaddag, config, board, ['o', 'l']);
|
|
458
|
-
expect(summarizeAll(results)).toEqual([
|
|
459
|
-
{ placed: [[4, 2, 'o', false]], points: 6, words: ['cho'] },
|
|
460
|
-
{
|
|
461
|
-
placed: [
|
|
462
|
-
[3, 3, 'o', false],
|
|
463
|
-
[4, 3, 'l', false],
|
|
464
|
-
],
|
|
465
|
-
points: 8,
|
|
466
|
-
words: ['ol', 'cho'],
|
|
467
|
-
},
|
|
468
|
-
{ placed: [[3, 3, 'o', false]], points: 6, words: ['cho'] },
|
|
469
|
-
{
|
|
470
|
-
placed: [
|
|
471
|
-
[4, 2, 'o', false],
|
|
472
|
-
[4, 3, 'l', false],
|
|
473
|
-
],
|
|
474
|
-
points: 8,
|
|
475
|
-
words: ['ol', 'cho'],
|
|
476
|
-
},
|
|
477
|
-
]);
|
|
478
|
-
});
|
|
479
|
-
|
|
480
|
-
it('plays a blank as a digraph tile', () => {
|
|
481
|
-
const gaddag = Gaddag.fromArray(['cho']);
|
|
482
|
-
const board = createBoard(7, 7, [[3, 3, 'o']]);
|
|
483
|
-
const results = generate(gaddag, config, board, [BLANK_CHARACTER]);
|
|
484
|
-
expect(summarizeAll(results)).toEqual([
|
|
485
|
-
{ placed: [[2, 3, 'ch', true]], points: 1, words: ['cho'] },
|
|
486
|
-
{ placed: [[3, 2, 'ch', true]], points: 1, words: ['cho'] },
|
|
487
|
-
]);
|
|
488
|
-
});
|
|
489
|
-
|
|
490
|
-
it('counts a digraph as a single tile for the bingo', () => {
|
|
491
|
-
const gaddag = Gaddag.fromArray(['cho']);
|
|
492
|
-
const bingoConfig = createConfig(SPANISH_MINI_TILES, { rackSize: 2 });
|
|
493
|
-
const results = generate(gaddag, bingoConfig, createBoard(7, 7), ['ch', 'o']);
|
|
494
|
-
expect(results.length).toBe(4);
|
|
495
|
-
expect(results.every((result) => result.points === 56)).toBe(true);
|
|
496
|
-
});
|
|
497
|
-
|
|
498
|
-
it('rejects digraphs composed from single tiles in perpendicular words', () => {
|
|
499
|
-
const gaddag = Gaddag.fromArray(['chico', 'ha']);
|
|
500
|
-
const board = createBoard(7, 7, [
|
|
501
|
-
[2, 1, 'c'],
|
|
502
|
-
[2, 3, 'i'],
|
|
503
|
-
[2, 4, 'c'],
|
|
504
|
-
[2, 5, 'o'],
|
|
505
|
-
]);
|
|
506
|
-
expect(generate(gaddag, config, board, ['h', 'a'])).toEqual([]);
|
|
507
|
-
});
|
|
508
|
-
|
|
509
|
-
it('rejects perpendicular words through board tiles that spell a digraph', () => {
|
|
510
|
-
const gaddag = Gaddag.fromArray(['cho', 'oa']);
|
|
511
|
-
const board = createBoard(7, 7, [
|
|
512
|
-
[2, 1, 'c'],
|
|
513
|
-
[2, 2, 'h'],
|
|
514
|
-
[3, 3, 'a'],
|
|
515
|
-
]);
|
|
516
|
-
expect(generate(gaddag, config, board, ['o'])).toEqual([]);
|
|
517
|
-
});
|
|
518
|
-
|
|
519
|
-
it('allows the digraph tile itself in perpendicular words', () => {
|
|
520
|
-
const gaddag = Gaddag.fromArray(['cha', 'cho']);
|
|
521
|
-
const board = createBoard(7, 7, [[2, 3, 'o']]);
|
|
522
|
-
const results = generate(gaddag, config, board, ['ch', 'a']);
|
|
523
|
-
expect(summarizeAll(results)).toEqual([
|
|
524
|
-
{
|
|
525
|
-
placed: [
|
|
526
|
-
[2, 2, 'ch', false],
|
|
527
|
-
[3, 2, 'a', false],
|
|
528
|
-
],
|
|
529
|
-
points: 12,
|
|
530
|
-
words: ['cha', 'cho'],
|
|
531
|
-
},
|
|
532
|
-
{ placed: [[1, 3, 'ch', false]], points: 6, words: ['cho'] },
|
|
533
|
-
{
|
|
534
|
-
placed: [
|
|
535
|
-
[1, 3, 'ch', false],
|
|
536
|
-
[1, 4, 'a', false],
|
|
537
|
-
],
|
|
538
|
-
points: 12,
|
|
539
|
-
words: ['cha', 'cho'],
|
|
540
|
-
},
|
|
541
|
-
{ placed: [[2, 2, 'ch', false]], points: 6, words: ['cho'] },
|
|
542
|
-
]);
|
|
543
|
-
});
|
|
544
|
-
});
|
|
545
|
-
|
|
546
|
-
describe('MoveGenerator - digraphs with the real Spanish config', () => {
|
|
547
|
-
const config = getConfig(Game.Scrabble, Locale.ES_ES);
|
|
548
|
-
|
|
549
|
-
it('plays chico through the center double-word bonus', () => {
|
|
550
|
-
const gaddag = Gaddag.fromArray(['chico']);
|
|
551
|
-
const results = generate(gaddag, config, createBoard(15, 15), ['ch', 'i', 'c', 'o']);
|
|
552
|
-
expect(results.length).toBe(8);
|
|
553
|
-
expect(toWords(results).every((word) => word === 'chico')).toBe(true);
|
|
554
|
-
expect(results.every((result) => result.points === 20)).toBe(true);
|
|
555
|
-
});
|
|
556
|
-
|
|
557
|
-
it('orders blank interpretations by tile order (ll before l)', () => {
|
|
558
|
-
const gaddag = Gaddag.fromArray(['pillo', 'pilo']);
|
|
559
|
-
const board = createBoard(15, 15, [
|
|
560
|
-
[5, 4, 'p'],
|
|
561
|
-
[6, 4, 'i'],
|
|
562
|
-
[8, 4, 'o'],
|
|
563
|
-
]);
|
|
564
|
-
const results = generate(gaddag, config, board, [BLANK_CHARACTER]);
|
|
565
|
-
expect(toWords(results)).toEqual(['pillo', 'pilo']);
|
|
566
|
-
expect(results.map((result) => result.points)).toEqual([5, 5]);
|
|
567
|
-
});
|
|
568
|
-
|
|
569
|
-
it('requires the rr tile to play words with a double r', () => {
|
|
570
|
-
const gaddag = Gaddag.fromArray(['carro']);
|
|
571
|
-
const board = createBoard(15, 15, [
|
|
572
|
-
[5, 4, 'c'],
|
|
573
|
-
[6, 4, 'a'],
|
|
574
|
-
]);
|
|
575
|
-
expect(generate(gaddag, config, board, ['r', 'r', 'o'])).toEqual([]);
|
|
576
|
-
const results = generate(gaddag, config, board, ['rr', 'o']);
|
|
577
|
-
expect(summarizeAll(results)).toEqual([
|
|
578
|
-
{
|
|
579
|
-
placed: [
|
|
580
|
-
[7, 4, 'rr', false],
|
|
581
|
-
[8, 4, 'o', false],
|
|
582
|
-
],
|
|
583
|
-
points: 13,
|
|
584
|
-
words: ['carro'],
|
|
585
|
-
},
|
|
586
|
-
]);
|
|
587
|
-
});
|
|
588
|
-
});
|
|
589
|
-
|
|
590
|
-
describe('MoveGenerator - bonuses', () => {
|
|
591
|
-
const gaddag = Gaddag.fromArray(['ab']);
|
|
592
|
-
const board = () => createBoard(5, 5, [[2, 2, 'a']]);
|
|
593
|
-
const characterBonus = (x: number, y: number, multiplier: number, score?: number) => ({
|
|
594
|
-
multiplier,
|
|
595
|
-
score,
|
|
596
|
-
type: BONUS_CHARACTER,
|
|
597
|
-
x,
|
|
598
|
-
y,
|
|
599
|
-
});
|
|
600
|
-
const wordBonus = (x: number, y: number, multiplier: number) => ({ multiplier, type: BONUS_WORD, x, y });
|
|
601
|
-
|
|
602
|
-
it('multiplies the placed tile on a character bonus', () => {
|
|
603
|
-
const config = createConfig(BASIC_TILES, { bonuses: [characterBonus(3, 2, 2)] });
|
|
604
|
-
expect(generate(gaddag, config, board(), ['b']).map((result) => result.points)).toEqual([7, 4]);
|
|
605
|
-
});
|
|
606
|
-
|
|
607
|
-
it('multiplies the whole word on a word bonus', () => {
|
|
608
|
-
const config = createConfig(BASIC_TILES, { bonuses: [wordBonus(3, 2, 3)] });
|
|
609
|
-
expect(generate(gaddag, config, board(), ['b']).map((result) => result.points)).toEqual([12, 4]);
|
|
610
|
-
});
|
|
611
|
-
|
|
612
|
-
it('applies a score-gated character bonus only to tiles with the matching score', () => {
|
|
613
|
-
const matching = createConfig(BASIC_TILES, { bonuses: [characterBonus(3, 2, 2, 3)] });
|
|
614
|
-
expect(generate(gaddag, matching, board(), ['b']).map((result) => result.points)).toEqual([7, 4]);
|
|
615
|
-
const mismatched = createConfig(BASIC_TILES, { bonuses: [characterBonus(3, 2, 2, 2)] });
|
|
616
|
-
expect(generate(gaddag, mismatched, board(), ['b']).map((result) => result.points)).toEqual([4, 4]);
|
|
617
|
-
});
|
|
618
|
-
|
|
619
|
-
it('gates blanks by the score of the character they represent', () => {
|
|
620
|
-
const config = createConfig(BASIC_TILES, { blankScore: 2, bonuses: [characterBonus(3, 2, 2, 3)] });
|
|
621
|
-
expect(generate(gaddag, config, board(), [BLANK_CHARACTER]).map((result) => result.points)).toEqual([5, 3]);
|
|
622
|
-
});
|
|
623
|
-
|
|
624
|
-
it('applies the first bonus when several share coordinates', () => {
|
|
625
|
-
const config = createConfig(BASIC_TILES, { bonuses: [characterBonus(3, 2, 2), wordBonus(3, 2, 3)] });
|
|
626
|
-
expect(generate(gaddag, config, board(), ['b']).map((result) => result.points)).toEqual([7, 4]);
|
|
627
|
-
});
|
|
628
|
-
|
|
629
|
-
it('does not apply bonuses under existing tiles', () => {
|
|
630
|
-
const config = createConfig(BASIC_TILES, { bonuses: [characterBonus(2, 2, 2)] });
|
|
631
|
-
expect(generate(gaddag, config, board(), ['b']).map((result) => result.points)).toEqual([4, 4]);
|
|
632
|
-
});
|
|
633
|
-
|
|
634
|
-
it('ignores bonuses outside the board', () => {
|
|
635
|
-
const config = createConfig(BASIC_TILES, { bonuses: [wordBonus(10, 10, 3)] });
|
|
636
|
-
expect(generate(gaddag, config, board(), ['b']).map((result) => result.points)).toEqual([4, 4]);
|
|
637
|
-
});
|
|
638
|
-
|
|
639
|
-
it('applies a bonus to both the main and the perpendicular word', () => {
|
|
640
|
-
const crossBoard = createBoard(5, 5, [
|
|
641
|
-
[2, 1, 'a'],
|
|
642
|
-
[1, 2, 'a'],
|
|
643
|
-
]);
|
|
644
|
-
const characterConfig = createConfig(BASIC_TILES, { bonuses: [characterBonus(2, 2, 2)] });
|
|
645
|
-
expect(generate(gaddag, characterConfig, crossBoard, ['b']).map((result) => result.points)).toEqual([4, 14, 4]);
|
|
646
|
-
const wordConfig = createConfig(BASIC_TILES, { bonuses: [wordBonus(2, 2, 3)] });
|
|
647
|
-
expect(generate(gaddag, wordConfig, crossBoard, ['b']).map((result) => result.points)).toEqual([4, 24, 4]);
|
|
648
|
-
});
|
|
649
|
-
|
|
650
|
-
it('multiplies multiple word bonuses together', () => {
|
|
651
|
-
const config = createConfig(BASIC_TILES, { bonuses: [wordBonus(2, 2, 2), wordBonus(4, 2, 2)] });
|
|
652
|
-
const results = generate(Gaddag.fromArray(['abcd']), config, createBoard(5, 5, [[1, 2, 'a']]), ['b', 'c', 'd']);
|
|
653
|
-
expect(summarizeAll(results)).toEqual([
|
|
654
|
-
{
|
|
655
|
-
placed: [
|
|
656
|
-
[2, 2, 'b', false],
|
|
657
|
-
[3, 2, 'c', false],
|
|
658
|
-
[4, 2, 'd', false],
|
|
659
|
-
],
|
|
660
|
-
points: 36,
|
|
661
|
-
words: ['abcd'],
|
|
662
|
-
},
|
|
663
|
-
]);
|
|
664
|
-
});
|
|
665
|
-
});
|
|
666
|
-
|
|
667
|
-
describe('MoveGenerator - bingo', () => {
|
|
668
|
-
const gaddag = Gaddag.fromArray(['abcd', 'ac']);
|
|
669
|
-
const board = () =>
|
|
670
|
-
createBoard(5, 5, [
|
|
671
|
-
[1, 2, 'a'],
|
|
672
|
-
[3, 1, 'a'],
|
|
673
|
-
]);
|
|
674
|
-
|
|
675
|
-
it('adds the score bingo when the whole rack is used', () => {
|
|
676
|
-
const config = createConfig(BASIC_TILES, { rackSize: 3 });
|
|
677
|
-
const results = generate(gaddag, config, board(), ['b', 'c', 'd']);
|
|
678
|
-
expect(toSortedPoints(results)).toEqual([4, 4, 4, 4, 59, 63]);
|
|
679
|
-
});
|
|
680
|
-
|
|
681
|
-
it('does not apply the bingo when fewer tiles than the rack size are placed', () => {
|
|
682
|
-
const config = createConfig(BASIC_TILES, { rackSize: 4 });
|
|
683
|
-
const results = generate(gaddag, config, board(), ['b', 'c', 'd']);
|
|
684
|
-
expect(toSortedPoints(results)).toEqual([4, 4, 4, 4, 9, 13]);
|
|
685
|
-
});
|
|
686
|
-
|
|
687
|
-
it('applies a multiplier bingo to the main word but not to perpendicular words', () => {
|
|
688
|
-
const config = createConfig(BASIC_TILES, { bingo: { multiplier: 3 }, rackSize: 3 });
|
|
689
|
-
const results = generate(gaddag, config, board(), ['b', 'c', 'd']);
|
|
690
|
-
expect(toSortedPoints(results)).toEqual([4, 4, 4, 4, 27, 31]);
|
|
691
|
-
});
|
|
692
|
-
});
|
|
693
|
-
|
|
694
|
-
describe('MoveGenerator - result ordering', () => {
|
|
695
|
-
it('orders results by direction, line, start, and end like the previous solver', () => {
|
|
696
|
-
const gaddag = Gaddag.fromArray(['ab', 'ba']);
|
|
697
|
-
const config = createConfig(BASIC_TILES);
|
|
698
|
-
const results = generate(gaddag, config, createBoard(5, 5), ['a', 'b']);
|
|
699
|
-
expectEnumerationOrder(results);
|
|
700
|
-
expect(toWords(results)).toEqual(['ab', 'ba', 'ab', 'ba', 'ab', 'ba', 'ab', 'ba']);
|
|
701
|
-
});
|
|
702
|
-
|
|
703
|
-
it('resolves same-span ties by rack order', () => {
|
|
704
|
-
const gaddag = Gaddag.fromArray(['ab', 'ba']);
|
|
705
|
-
const config = createConfig(BASIC_TILES);
|
|
706
|
-
const results = generate(gaddag, config, createBoard(5, 5), ['b', 'a']);
|
|
707
|
-
expect(toWords(results)).toEqual(['ba', 'ab', 'ba', 'ab', 'ba', 'ab', 'ba', 'ab']);
|
|
708
|
-
});
|
|
709
|
-
|
|
710
|
-
it('orders blank interpretations by tile order, after real tiles', () => {
|
|
711
|
-
const gaddag = Gaddag.fromArray(['ab', 'ac', 'ad']);
|
|
712
|
-
const config = createConfig(BASIC_TILES);
|
|
713
|
-
const board = createBoard(5, 5, [[2, 2, 'a']]);
|
|
714
|
-
const results = generate(gaddag, config, board, ['d', BLANK_CHARACTER]);
|
|
715
|
-
expect(summarizeAll(results)).toEqual([
|
|
716
|
-
{ placed: [[3, 2, 'd', false]], points: 3, words: ['ad'] },
|
|
717
|
-
{ placed: [[3, 2, 'b', true]], points: 1, words: ['ab'] },
|
|
718
|
-
{ placed: [[3, 2, 'c', true]], points: 1, words: ['ac'] },
|
|
719
|
-
{ placed: [[3, 2, 'd', true]], points: 1, words: ['ad'] },
|
|
720
|
-
{
|
|
721
|
-
placed: [
|
|
722
|
-
[1, 3, 'a', true],
|
|
723
|
-
[2, 3, 'd', false],
|
|
724
|
-
],
|
|
725
|
-
points: 5,
|
|
726
|
-
words: ['ad', 'ad'],
|
|
727
|
-
},
|
|
728
|
-
{ placed: [[2, 3, 'd', false]], points: 3, words: ['ad'] },
|
|
729
|
-
{ placed: [[2, 3, 'b', true]], points: 1, words: ['ab'] },
|
|
730
|
-
{ placed: [[2, 3, 'c', true]], points: 1, words: ['ac'] },
|
|
731
|
-
{ placed: [[2, 3, 'd', true]], points: 1, words: ['ad'] },
|
|
732
|
-
{
|
|
733
|
-
placed: [
|
|
734
|
-
[3, 1, 'a', true],
|
|
735
|
-
[3, 2, 'd', false],
|
|
736
|
-
],
|
|
737
|
-
points: 5,
|
|
738
|
-
words: ['ad', 'ad'],
|
|
739
|
-
},
|
|
740
|
-
]);
|
|
741
|
-
expect(results.map(({ id }) => id)).toEqual([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
|
|
742
|
-
});
|
|
743
|
-
});
|
|
744
|
-
|
|
745
|
-
describe('MoveGenerator - equivalence with a brute-force reference solver', () => {
|
|
746
|
-
const words = [
|
|
747
|
-
'ab',
|
|
748
|
-
'ace',
|
|
749
|
-
'ad',
|
|
750
|
-
'ae',
|
|
751
|
-
'ba',
|
|
752
|
-
'bad',
|
|
753
|
-
'be',
|
|
754
|
-
'bead',
|
|
755
|
-
'bed',
|
|
756
|
-
'bee',
|
|
757
|
-
'cab',
|
|
758
|
-
'cad',
|
|
759
|
-
'cede',
|
|
760
|
-
'dab',
|
|
761
|
-
'dace',
|
|
762
|
-
'dad',
|
|
763
|
-
'deb',
|
|
764
|
-
'deed',
|
|
765
|
-
'ea',
|
|
766
|
-
'ed',
|
|
767
|
-
];
|
|
768
|
-
const gaddag = Gaddag.fromArray(words);
|
|
769
|
-
const tiles: TileScores = { a: 1, b: 3, c: 3, d: 2, e: 1 };
|
|
770
|
-
const config = createConfig(tiles);
|
|
771
|
-
const cluster = (): BoardTilePlacement[] => [
|
|
772
|
-
[1, 1, 'b'],
|
|
773
|
-
[1, 2, 'a'],
|
|
774
|
-
[1, 3, 'd'],
|
|
775
|
-
[2, 2, 'b'],
|
|
776
|
-
[3, 2, 'e'],
|
|
777
|
-
];
|
|
778
|
-
|
|
779
|
-
it('matches on a hand-made cluster', () => {
|
|
780
|
-
const results = expectMatchesReference(gaddag, config, createBoard(5, 5, cluster()), ['a', 'd', 'e']);
|
|
781
|
-
expect(results.length).toBeGreaterThan(0);
|
|
782
|
-
});
|
|
783
|
-
|
|
784
|
-
it('matches with blanks', () => {
|
|
785
|
-
const results = expectMatchesReference(gaddag, config, createBoard(5, 5, cluster()), ['b', BLANK_CHARACTER]);
|
|
786
|
-
expect(results.length).toBeGreaterThan(0);
|
|
787
|
-
});
|
|
788
|
-
|
|
789
|
-
it('matches on a rectangular board', () => {
|
|
790
|
-
const board = createBoard(7, 5, [
|
|
791
|
-
[3, 2, 'a'],
|
|
792
|
-
[4, 2, 'b'],
|
|
793
|
-
]);
|
|
794
|
-
const results = expectMatchesReference(gaddag, config, board, ['a', 'e', 'd', BLANK_CHARACTER]);
|
|
795
|
-
expect(results.length).toBeGreaterThan(0);
|
|
796
|
-
});
|
|
797
|
-
|
|
798
|
-
it('matches on the empty board', () => {
|
|
799
|
-
const results = expectMatchesReference(gaddag, config, createBoard(5, 5), ['b', 'a', 'd']);
|
|
800
|
-
expect(results.length).toBeGreaterThan(0);
|
|
801
|
-
});
|
|
802
|
-
|
|
803
|
-
it('matches with bonuses', () => {
|
|
804
|
-
const bonusConfig = createConfig(tiles, {
|
|
805
|
-
bonuses: [
|
|
806
|
-
{ multiplier: 2, type: BONUS_CHARACTER, x: 1, y: 2 },
|
|
807
|
-
{ multiplier: 2, score: 3, type: BONUS_CHARACTER, x: 2, y: 1 },
|
|
808
|
-
{ multiplier: 3, type: BONUS_WORD, x: 3, y: 3 },
|
|
809
|
-
{ multiplier: 2, type: BONUS_WORD, x: 0, y: 0 },
|
|
810
|
-
],
|
|
811
|
-
});
|
|
812
|
-
const results = expectMatchesReference(gaddag, bonusConfig, createBoard(5, 5, cluster()), [
|
|
813
|
-
'a',
|
|
814
|
-
'e',
|
|
815
|
-
BLANK_CHARACTER,
|
|
816
|
-
]);
|
|
817
|
-
expect(results.length).toBeGreaterThan(0);
|
|
818
|
-
});
|
|
819
|
-
|
|
820
|
-
it('matches with a score bingo', () => {
|
|
821
|
-
const bingoConfig = createConfig(tiles, { rackSize: 3 });
|
|
822
|
-
const results = expectMatchesReference(gaddag, bingoConfig, createBoard(5, 5, cluster()), ['a', 'd', 'e']);
|
|
823
|
-
expect(results.length).toBeGreaterThan(0);
|
|
824
|
-
});
|
|
825
|
-
|
|
826
|
-
it('matches with a multiplier bingo', () => {
|
|
827
|
-
const bingoConfig = createConfig(tiles, { bingo: { multiplier: 2 }, rackSize: 3 });
|
|
828
|
-
const results = expectMatchesReference(gaddag, bingoConfig, createBoard(5, 5, cluster()), ['a', 'd', 'e']);
|
|
829
|
-
expect(results.length).toBeGreaterThan(0);
|
|
830
|
-
});
|
|
831
|
-
|
|
832
|
-
it('matches with digraph tiles', () => {
|
|
833
|
-
const spanishWords = ['cal', 'callo', 'chal', 'chico', 'cho', 'col', 'hilo', 'hola', 'loca', 'ola', 'olla'];
|
|
834
|
-
const spanishGaddag = Gaddag.fromArray(spanishWords);
|
|
835
|
-
const spanishConfig = createConfig(SPANISH_MINI_TILES);
|
|
836
|
-
const board = createBoard(6, 6, [
|
|
837
|
-
[1, 2, 'ch'],
|
|
838
|
-
[2, 2, 'i'],
|
|
839
|
-
[3, 2, 'c'],
|
|
840
|
-
[1, 3, 'o'],
|
|
841
|
-
[4, 1, 'll'],
|
|
842
|
-
[4, 2, 'o'],
|
|
843
|
-
[3, 4, 'o'],
|
|
844
|
-
]);
|
|
845
|
-
const tileResults = expectMatchesReference(spanishGaddag, spanishConfig, board, ['ch', 'o', 'l', 'a']);
|
|
846
|
-
expect(tileResults.length).toBeGreaterThan(0);
|
|
847
|
-
const blankResults = expectMatchesReference(spanishGaddag, spanishConfig, board, ['o', 'l', BLANK_CHARACTER]);
|
|
848
|
-
expect(blankResults.length).toBeGreaterThan(0);
|
|
849
|
-
const singleHResults = expectMatchesReference(spanishGaddag, spanishConfig, board, ['h', 'o', 'a']);
|
|
850
|
-
expect(singleHResults).toEqual([]);
|
|
851
|
-
});
|
|
852
|
-
|
|
853
|
-
it('matches on random boards', () => {
|
|
854
|
-
const scenarios: [number, string[]][] = [
|
|
855
|
-
[11, ['a', 'b', BLANK_CHARACTER]],
|
|
856
|
-
[22, ['d', 'e', 'a']],
|
|
857
|
-
[33, ['b', 'c', BLANK_CHARACTER]],
|
|
858
|
-
];
|
|
859
|
-
let totalResults = 0;
|
|
860
|
-
|
|
861
|
-
for (const [seed, rack] of scenarios) {
|
|
862
|
-
const board = createRandomBoard(5, 5, ['a', 'b', 'c', 'd', 'e'], createRandom(seed));
|
|
863
|
-
totalResults += generate(gaddag, config, board, rack).length;
|
|
864
|
-
expectMatchesReference(gaddag, config, board, rack);
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
expect(totalResults).toBeGreaterThan(0);
|
|
868
|
-
});
|
|
869
|
-
});
|
|
870
|
-
|
|
871
|
-
function generate(gaddag: Gaddag, config: Config, board: Board, rack: string[]): Result[] {
|
|
872
|
-
return generateJson(gaddag, config, board, rack).map((json) => Result.fromJson(json, board));
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
function generateJson(gaddag: Gaddag, config: Config, board: Board, rack: string[]): ResultJson[] {
|
|
876
|
-
return new MoveGenerator(gaddag, config, board, createRack(rack)).run();
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
function expectMatchesReference(gaddag: Gaddag, config: Config, board: Board, rack: string[]): Result[] {
|
|
880
|
-
const results = generate(gaddag, config, board, rack);
|
|
881
|
-
const signatures = results.map(signatureOf);
|
|
882
|
-
expect(new Set(signatures).size).toBe(signatures.length);
|
|
883
|
-
expect(results.map(({ id }) => id)).toEqual(results.map((_, index) => index));
|
|
884
|
-
expectEnumerationOrder(results);
|
|
885
|
-
expect([...signatures].sort()).toEqual(new ReferenceSolver(gaddag, config, board, createRack(rack)).solve());
|
|
886
|
-
return results;
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
function summarizeAll(results: Result[]): MoveSummary[] {
|
|
890
|
-
return results.map(summarize);
|
|
891
|
-
}
|
|
892
|
-
|
|
893
|
-
function summarize(result: Result): MoveSummary {
|
|
894
|
-
return {
|
|
895
|
-
placed: result.cells.filter((cell) => cell.isEmpty).map(toPlacedTile),
|
|
896
|
-
points: result.points,
|
|
897
|
-
words: result.words,
|
|
898
|
-
};
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
function toPlacedTile(cell: Cell): PlacedTile {
|
|
902
|
-
return [cell.x, cell.y, cell.tile.character, cell.tile.isBlank];
|
|
903
|
-
}
|
|
904
|
-
|
|
905
|
-
function toWords(results: Result[]): string[] {
|
|
906
|
-
return results.map((result) => result.word);
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
function toSortedPoints(results: Result[]): number[] {
|
|
910
|
-
return results.map((result) => result.points).sort((a, b) => a - b);
|
|
911
|
-
}
|
|
912
|
-
|
|
913
|
-
function coversCell(result: Result, x: number, y: number): boolean {
|
|
914
|
-
return result.cells.some((cell) => cell.x === x && cell.y === y);
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
function signatureOf(result: Result): string {
|
|
918
|
-
const placed = result.cells
|
|
919
|
-
.filter((cell) => cell.isEmpty)
|
|
920
|
-
.map((cell) => `${cell.x},${cell.y},${cell.tile.character},${cell.tile.isBlank ? 1 : 0}`)
|
|
921
|
-
.sort()
|
|
922
|
-
.join(' ');
|
|
923
|
-
const words = [...result.words].sort().join(' ');
|
|
924
|
-
return `${placed} | ${words} | ${result.points}`;
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
function expectEnumerationOrder(results: Result[]): void {
|
|
928
|
-
const keys = results.map(enumerationKey);
|
|
929
|
-
expect(keys).toEqual([...keys].sort());
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
function enumerationKey(result: Result): string {
|
|
933
|
-
const [firstCell] = result.cells;
|
|
934
|
-
const lastCell = result.cells[result.cells.length - 1];
|
|
935
|
-
const isHorizontal = firstCell.y === lastCell.y;
|
|
936
|
-
const key = isHorizontal ? [0, firstCell.y, firstCell.x, lastCell.x] : [1, firstCell.x, firstCell.y, lastCell.y];
|
|
937
|
-
return key.map((value) => String(value).padStart(2, '0')).join('|');
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
function createConfig(tileScores: TileScores, overrides: Partial<ConfigJson> = {}): Config {
|
|
941
|
-
return new Config({
|
|
942
|
-
bingo: { score: 50 },
|
|
943
|
-
blankScore: 0,
|
|
944
|
-
blanksCount: 2,
|
|
945
|
-
boardHeight: 15,
|
|
946
|
-
boardWidth: 15,
|
|
947
|
-
bonuses: [],
|
|
948
|
-
game: Game.Scrabble,
|
|
949
|
-
locale: Locale.EN_GB,
|
|
950
|
-
name: 'MoveGenerator tests',
|
|
951
|
-
rackSize: 7,
|
|
952
|
-
tiles: Object.entries(tileScores).map(([character, score]) => ({ character, count: 1, score })),
|
|
953
|
-
...overrides,
|
|
954
|
-
});
|
|
955
|
-
}
|
|
956
|
-
|
|
957
|
-
function createBoard(width: number, height: number, placements: BoardTilePlacement[] = []): Board {
|
|
958
|
-
const board = Board.create(width, height);
|
|
959
|
-
|
|
960
|
-
for (const [x, y, character, isBlank = false] of placements) {
|
|
961
|
-
board.updateCell(x, y, () => new Cell({ isEmpty: false, tile: new Tile({ character, isBlank }), x, y }));
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
return board;
|
|
965
|
-
}
|
|
966
|
-
|
|
967
|
-
function createRack(characters: string[]): Tile[] {
|
|
968
|
-
return characters.map((character) =>
|
|
969
|
-
character === BLANK_CHARACTER
|
|
970
|
-
? new Tile({ character: '', isBlank: true })
|
|
971
|
-
: new Tile({ character, isBlank: false }),
|
|
972
|
-
);
|
|
973
|
-
}
|
|
974
|
-
|
|
975
|
-
function createRandomBoard(width: number, height: number, characters: string[], random: () => number): Board {
|
|
976
|
-
const placements: BoardTilePlacement[] = [];
|
|
977
|
-
|
|
978
|
-
for (let y = 0; y < height; ++y) {
|
|
979
|
-
for (let x = 0; x < width; ++x) {
|
|
980
|
-
if (random() < 0.2) {
|
|
981
|
-
placements.push([x, y, characters[Math.floor(random() * characters.length)]]);
|
|
982
|
-
}
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
|
|
986
|
-
if (placements.length === 0) {
|
|
987
|
-
placements.push([Math.floor(width / 2), Math.floor(height / 2), characters[0]]);
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
return createBoard(width, height, placements);
|
|
991
|
-
}
|
|
992
|
-
|
|
993
|
-
function createRandom(seed: number): () => number {
|
|
994
|
-
let state = (seed % 2147483647) + 1;
|
|
995
|
-
return () => {
|
|
996
|
-
state = (state * 48271) % 2147483647;
|
|
997
|
-
return state / 2147483647;
|
|
998
|
-
};
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
function createWideAlphabet(size: number): TileScores {
|
|
1002
|
-
const tiles: TileScores = { a: 1, b: 3 };
|
|
1003
|
-
|
|
1004
|
-
for (let index = 2; index < size; ++index) {
|
|
1005
|
-
tiles[String.fromCharCode(0x100 + index)] = 1;
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
return tiles;
|
|
1009
|
-
}
|