Crossword Solver

Crossword Solver

Simple+
English

“Looking at the sky, he suddenly saw that it had become black. Then white again, but with great rippling circles. The circles were vultures wheeling around the sun. The vultures disappeared, to be replaced by checkers squares ready to be played on. On the board, the pieces moved around incredibly rapidly, winning dozens of games every minute. They were scarcely lined up before they started rushing at each other again, banging into each other, forming fighting combinations, wiping the other side out in the wink of an eye. Then the squares scattered, giving way to the grille of a crossword puzzle, and here, too, words flashed, drove each other away, clustered, were erased. They were all very long words, like Catalepsy, Thunderbird, Superrequeteriquísímo and Anticonstitutionally.”
― Jean-Marie G. Le Clézio, The Book of Flights

A crossword is a word puzzle that normally takes the form of a square or a rectangular grid of white and black shaded squares. The goal is to fill the white squares with letters, forming words or phrases, by solving clues which lead to the answers. In languages that are written left-to-right, the answer words and phrases are placed in the grid from left to right and from top to bottom. The shaded squares are used to separate the words or phrases.

We will solve a few crosswords which have a lattice-like structure, with a higher percentage of shaded squares, leaving up to half the letters in an answer unchecked. For example, if the top row has an answer running all the way across, there will be no across answers in the second row. Your program receives a crossword pattern without clues and numbers, and it should determine word positions itself with the following rules:
- If a cell is placed in the most left column or neighbour left cell is shaded, and the neighbouring right cell is empty, then this cell is the beginning of left-to-right word;
- If a cell is placed in the top row or the neighbouring upward cell is shaded, and neighbour down cell is empty, then this cell is the beginning of up-to-down word.
All words have a length greater than or equal to 3 letters. All empty cells should filled in.

You are given a crossword as a sequence of strings, where "X" is a shaded cell and "." is an empty cell. You are also given the predefined list of words in lowercase. (You can find it here or in the default code). This list is the same for all crosswords and contains about 1500 nouns. You should use only the given words.

You don't need to find all of the possible solutions. It will be enough to find any solution which fills the crossword puzzle and contains the correct words.

crossword

Input: Two arguments. A crossword as a tuple of strings and the words as a tuple of strings.

Output: Any solved variant of the crossword as a tuple/list of strings.

Example:

solver(('.XXX.', '...X.', '.X.X.', '.....'))
    

How it is used: This is a classic constraint satisfaction problem and can save you time with the daily crosswords.

Precondition:
3 < len(crossword) ≤ 10
all(3 < len(row) ≤ 10 and len(row) == len(crossword[0]) for row in crossword)

45
Settings
Code:
Other:
Invalid hot key. Each hot key should be unique and valid
Hot keys:
CheckiO Extensions

CheckiO Extensions allow you to use local files to solve missions. More info in a blog post.

In order to install CheckiO client you'll need installed Python (version at least 3.8)

Install CheckiO Client first:

pip3 install checkio_client

Configure your tool

checkio --domain=py config --key=

Sync solutions into your local folder

checkio sync

(in beta testing) Launch local server so your browser can use it and sync solution between local file end extension on the fly. (doesn't work for safari)

checkio serv -d

Alternatevly, you can install Chrome extension or FF addon

checkio install-plugin
checkio install-plugin --ff
checkio install-plugin --chromium

Read more here about other functionality that the checkio client provides. Feel free to submit an issue in case of any difficulties.

Pair Programming (Beta-version)

Welcome to Pair Programming! Engage in real-time collaboration on coding projects by starting a session and sharing the provided unique URL with friends or colleagues. This feature is perfect for joint project development, debugging, or learning new skills together. Simply click 'Start Session' to begin your collaborative coding journey!

Waiting for Pair Programming to start...

You are trying to join a pair programming session that has not started yet.

Please wait for the session creator to join.

Waiting for Pair Programming to reconnect...

It looks like the creator of the pair programming session closed the editor window.

It might happen accidentally, so that you can wait for reconnection.

×
 
 
<< <
> >>
exec show

Whats Next?

Free accounts will see Best CheckiO solutions with some delay.
Best Solutions will be opened in a moment
Become Awesome and Don't wait
The next stage is ""
Will be activated in
View More Solutions Random Review Solutions Go to the next mission