זהו משחק דמוי "שבץ נא" אונליין לשחקן יחיד (מול המחשב) או לשני שחקנים.
ניתן לשחק במשחק כאן.
"The Last Word" is an online Scrabble™-like game in Hebrew. Users can choose to play the game individually against the computer or with a partner in a two player mode. The game is available online here.
By default, the game only accepts words which are included in its internal dictionary.
Since the official Hebrew Scrabble™ is not freely available (if it even exists),
the next best option was to base the dictionary on Hspell, the Hebrew spell-check project.
However, this is far from being ideal for several reasons:
- The amount of words accepted by a spellchecker is much larger than the amount of words legal in Scrabble™. For example, a spellchecker would accept "מכוניתי" and "מכוניותיכן" while in scrabble we'd only want to accept "מכונית".
- Hspell was designed to be 100% and strictly compliant with the official niqqud-less spelling rules published by the Academy of the Hebrew Language. However, a few of the Academia's official spelling decisions are relatively unknown to the general public, and sometimes even disputed by popular publishers. For example, it won't accept "אמא" (officially, the correct word is "אימא") or "אמיתי" (officially should be "אמתי").
- While probably being the most extensive source of Hebrew words openly available, it is not complete, and hasn't been updated for a few years.
- Hspell contains also names and other types of words which shouldn't be accepted in a Scrabble™ game.
Therefore, an attempt was made to select only a subset of the words accepted by Hspell. Details on the process are available here.
As a partial mitigation, it's possible to force the game to accept the words in a certain move by using an "objection". Alternatively, it's possible to disable the dictionary-check via the Settings menu of the game.
Suggestion for alternative dictionaries are welcome (the dictionaries must have a license compatible with "The Last Word"'s own license as listed below).
The computer's AI is based on a paper by Andrew W. Appel and Guy J. Jacobson titled "The World’s Fastest Scrabble Program". For whoever's interested in diving into the algorithm, there's a good video walkthrough here.
Currently the AI supports two difficulty levels:
- Novice: The computer randomly selects a legal move
- Expert: The computer selects the move that will maximize the amount of points for the current turn
The dictionary is stored as a DAWG (Directed Acyclic Word Graph) which significantly reduces its size. In addition, given a prefix, this data structure allows iterating all the next-letters for all the words that start with the given prefix. Such an ability is needed in order to implement the algorithm listed above.
There are a few alternatives for a Hebrew Scrabble™-like game online:
I developed this game as a side project in order to get familiar with Typescript.
All the logic is implemented on the client side and only requires a static server.
The project includes a Docker file that can be used to setup the game locally.
- Build the container with
docker-compose up -d --build
- Run the container with
docker-compose up -d
- Attach to the container with
docker-compose exec app sh
- (First time only) Install the packages from
npm
usingnpm install
- Run
npm start
to start the server - Alternatively run
npx webpack --mode production
to bundle the code. This would result in some*.js
files being written todist
- When done, execute
exit
to exit the shell - Execute
docker-compose down
to stop the container
For the online version hosted in GitHub Pages, changes to the Typescript files only take effect once the code is bundled and submitted to GitHub.
"The Last Word" is released under AGPLv3.
"The Last Word" utilizes the Hspell Dictionary as part of its functionality. This dictionary is released under AGPLv3
The dictionary's DAWG is generated by dawgdic and is extracted on the client side by logic ported to Typescript from the DAWG-Python project (which was released under MIT license).
"The Last Word" is not officially affiliated with Scrabble™ or with Hasbro / Mattel.