Skip to content

warmans/go-crossword

Repository files navigation

Go Crossword

Package to generate a valid crossword puzzle from a list of words/clues.

Loosely based on: https://stackoverflow.com/a/22256214

The package does not guarantee all words can be placed in the grid but in general will usually get there if it's possible to do so (given enough attempts).

Interactive: DEMO

Example:

  $ go run example/simple/main.go sample/words.json  

or to see completed:

  $ SOLVE_ALL=true go run example/simple/main.go sample/words.json  

This will generate the following crossword from the given words file: sample/words.json

Note on interactive crosswords

If the crossword is being solved interactively you would need to store the generated Crossword (e.g. json encode it to a file). This can easily be decoded and rendered without altering the layout.

About

Crossword generator Go package.

Resources

License

Stars

Watchers

Forks

Packages

No packages published