Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintPuzzle ¶
func PrintPuzzle(puzzle Puzzle)
PrintPuzzle prints the grid of the puzzle one row at a time. It takes in a parameter puzzle of type Puzzle.
func ReadWordsFromFile ¶
Types ¶
type Dictionary ¶
type Dictionary struct {
// contains filtered or unexported fields
}
func LoadDictionary ¶
func LoadDictionary(dictionaryPath string) (*Dictionary, error)
func (*Dictionary) CloseMatches ¶
func (d *Dictionary) CloseMatches(word string) []string
func (*Dictionary) RandomWord ¶
func (d *Dictionary) RandomWord() string
func (*Dictionary) RandomWords ¶
func (d *Dictionary) RandomWords(count int) []string
type Puzzle ¶
type Puzzle struct {
// contains filtered or unexported fields
}
func GeneratePDF ¶
func GeneratePuzzle ¶
func GeneratePuzzle(gridSize int, words []string, columns int, difficulty int, dictionaryPath string, verbose bool) (Puzzle, error)
GeneratePuzzle creates a Word Search puzzle based on the provided gridSize, words, columns, and difficulty. The dictionaryPath is used to load the dictionary for generating random letters in the grid.
type PuzzleConfig ¶
type PuzzleConfig struct { Title string `yaml:"title"` Size int `yaml:"size"` Columns int `yaml:"columns"` Difficulty int `yaml:"difficulty"` Words []string `yaml:"words"` OutputBasename string `yaml:"output_basename"` Background string `yaml:"background"` }
func ParseConfig ¶
func ParseConfig(filename string) (*PuzzleConfig, error)
Click to show internal directories.
Click to hide internal directories.