Git Product home page Git Product logo

crossword_generator's Introduction

Crossword Generator

This very simple Python script generates a clueless crossword puzzle. It harnesses the capabilities of Python and LaTeX to output the puzzle in a printable PDF.

Usage

All you have to do is run the script on a folder where a "words.txt" file with one word per line exists. I recommend using the aforementioned lists! Run ./crossword_generator -h to see all available options.

Output

The script depends on LaTeX for producing the PDF output. However, the grid can be (and is, by default) printed to the screen. The PDF is print-ready, and includes both the puzzle (with the needed words) and the solution, making the output of each run completely self-contained.

Performance Considerations

On my consumer-grade machine (i7-6700HQ) the algorithm can generate a 20x20 grid with 50% completion in some 45 10 4 seconds (with the new algorithm). I am currently looking into ways of improving this mark, and already have a ton of ideas, so stay tuned!

Algorithms

I purposefully designed and implemented this little project without performing research on crossword generation techniques; I wanted to see if I could do it by myself. I am essentially using this project as a testbench of sorts for coming up with search algorithms.

The basic algorithm currently in use essentially

  1. Fills up the grid with random words in random positions, as long as they fit and do not collide;
  2. Removes any isolated words, i.e. words that do not touch any others;
  3. Repeats step 1.

This can be done ad infinitum. However, the time it takes to find valid possibilities scales exponentially with how full the grid already is, so getting past 60% occupancy takes quite a while.

crossword_generator's People

Contributors

gondsm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

crossword_generator's Issues

Python has stopped working

Hey @gondsm , thank you for this wonderful crossword generator. I experienced an error when running the .py file and wondered if you may have insight as to how i can fix this issue.. Your assistance is humbly appreciated. Attached below is the error im getting after i run the code which forces me to close the program before the latex finishes generating.

image

How to understand instructions

How on earth is a beginner with GitHub supposed to understand the User instructions, The information seems scattered and instructions or links don't seem to be in any logical order as some seem to be unnecessary..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.