README.md

Russian Pangram Generator

A high-performance C program that generates Russian sentences where each letter of the alphabet is used exactly once (pangrams).

Features

  • Ultra-fast search: Uses bit encoding for letter sets and optimized algorithms
  • Flexible input: Accepts custom starting words and configurable word list sizes
  • Configurable search depth: Switch between full and filtered search strategies

Prerequisites

  • GCC compiler (version 4.8 or higher)
  • Make utility
  • UTF-8 locale support

Building

Quick Build

make

Manual Build

gcc -O3 -Wall -Wextra -std=c99 -o pangram_generator pangram_generator.c

Clean Build

make clean
make

Usage

Basic Usage

./pangram_generator <word_list_file> [target_word] [max_time] [max_words] [filtered_depth]

Parameters

  • word_list_file (required): Path to the text file containing Russian words (one per line)
  • target_word (required): Starting word for pangram generation. If not in the word list, it will be validated and used
  • max_time (optional): Maximum search time in seconds (default: 60)
  • max_words (optional): Maximum number of words to load from the file to reduce trash words (default: all words)
  • filtered_depth (optional): Depth at which to switch to filtered search (default: 2)

Examples

Generate pangrams from a word list

./pangram_generator russian_words.txt

Start with a specific word

./pangram_generator russian_words.txt "объяснить"

Limit search time and word count

./pangram_generator russian_words.txt "объяснить" 60 5000

Use filtered search from depth 3

./pangram_generator russian_words.txt "объяснить" 60 5000 3

Use a custom word not in the list

./pangram_generator russian_words.txt "съев мяч зэк ждёт" 30 1000 2

Example Results

The program successfully found this pangram: "съев мяч, щипцы, эльф-конюх ждёт груз шайб"

Makefile Targets

make all          # Build the program
make clean        # Remove build artifacts
make run          # Run with default parameters
make run-filtered # Run with filtered search
make run-full     # Run with full search

Input File Format

The word list file should contain Russian words, one per line, in UTF-8 encoding:

абажур
абзац
абонемент
...

Requirements for words:

  • No duplicate letters within a word
  • UTF-8 encoded Russian text
  • One word per line
  • No empty lines or special characters

Performance Tuning

  • Increase max_words: More words = more potential solutions
  • Adjust filtered_depth: 1 or 2 is optimal
  • Use rare starting words: Long words with ъ, э, ё, ф, ц work best
  • Limit search time: Use max_time to prevent long runs

File Structure

.
├── pangram_generator.c    # Main C source code
├── Makefile              # Build configuration
├── README.md            # This file
├── russian_words.txt    # Word list

License

This project is open source. Feel free to use and modify as needed.

Acknowledgments

  • Russian word data from
  • UTF-8 handling techniques from Unicode standards
  • Bit manipulation algorithms for set operations
Описание
Russian Pangram Generator
Конвейеры
0 успешных
0 с ошибкой
Разработчики