Crate crossword_puzzle

Crate crossword_puzzle 

Source
Expand description

This crate provides functionality for generating crossword puzzles. It includes data structures for representing words, grid, and algorithms for placing words and solving the puzzle.

Modules§

error
Defines the error types used throughout the crossword puzzle generator. This module provides a structured way to handle various issues that can arise during word processing, grid generation, and other application-level operations.
word
This module defines the core data structures for representing words and their properties within the crossword puzzle generation logic. It includes definitions for Direction, Position, Segment, and Word, along with their associated methods for creation, manipulation, and validation.

Structs§

Grid
Grid represents the crossword puzzle board and manages the placement and validation of words. It dynamically resizes to accommodate words and provides methods for adding words and finding valid placements.
Neighbor
Neighbor represents the characters and their positions in the cells immediately adjacent to a given position on the crossword grid. It is used internally to check for conflicts or valid placements when adding words.
PossibleWord

Functions§

backtrack
A backtracking function to generate the crossword puzzle.
eliminate_words
Eliminates words that do not share any common characters with other words.
generate
Generates a crossword puzzle grid from a given list of words.