Skip to content

erikoest/kryss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

488921e · Mar 9, 2025

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kryss

Crossword solver

Usage

  • Build code:
cargo build release
  • Solve a crossword:
./target/release/kryss examples/dagogtid-2017-12-22.kryss
> help

Description

Kryss is a crossword solver with tty user interface. The solver takes a description file as input argument:

./target/release/kryss [--dictionary dict.json] mycrossword.kryss

After starting up, kryss lookups up unknown keywords from the norwegian crossword helper website https://gratiskryss.no. It then tries to solve all the words which have exactly one candidate.

Commands

Solve

Solve all words which have exactly one candidate until all words have either zero or multiple candidates.

Board

Show board.

Words

List words. The additional commands placed (solved words), unplaced (unsolved words), missing (zero candidates), ambiguous (multiple candidates) are available and will show only words with the respectice conditions.

Crossing <key>

For a given word, show all the crossing words.

Candidates <key>

For a given word, show the known candidate words.

Info <key>

For a given word, show miscellaneous information. This includes the word position and orientation, crossing words and candidate list.

Solution

Show the solution sentence.

Place <key> <word>

Place a word into the crossword. The word is added to the dictionary if it is not already known.

lookup <key> [<length> | <hint>]

Lookup candidates for a keyword from the dictionary. The dictionary consists of candidate words for all the known keywords. Candidates are retrieved from the https://gratiskryssord.no website. The second parameter is either numeric, giving the length of the word, or a partially solved word on the form ..ab.c. with dots representing an unknown character.

add <key> <word>

Add word to the dictionary.

store board [<filename>]

Store the board. A filename may optionally be specified. The name of the input description file is the default. The stored file has the format of the description file, but with the placed words added to it.

store dictionary [<filename>]

Store the dictionary file. A filename may optionally be specified. The file dict.json is the default (this is also the dictionary file read at startup).

set colors [on|off]

Set tty colors on or off.

Crossword description file

Each line in the desctiption file represents a word. The format is:

O,X,Y,L,key[=word]

Where:

  • O is orientation
    • R - right
    • L - left
    • D - down
    • U - up
  • X is horizontal coordinate of the first character
  • Y is vertical coordinate of the first character
  • L is length
  • key is the hint word. If the word is solved, the key is suffixed with an =word part.

The solution sentence has the form:

S,O1,X1,Y1,L1,O2,X2,Y2,L2,...

It represents a list of words, each of which does not have a key. Together they form the solution sentence.

About

Crossword solver

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages