= Acrosslite
http://github.com/samullen/acrosslite
A Ruby library for parsing Across Lite crossword puzzle (.puz) files.
The Across Lite format is probably the most popular format for encoding crossword puzzles. This library in its current incarnation provides a means for retrieving the encoded crossword information from that format. In the future I may take a go at building an encoder, but there are some legal issues around doing such.
For more information about acrosslite, go to http://litsoft.com.
== Installation
The acrosslite gem is hosted on RubyGems (http://rubygems.org).
== Getting Started
Instantiation of the library can be done in one of two ways: 1) passing in the full path to a file; 2) by passing in the puzzle blob.
require 'acrosslite'
ac = Acrosslite.new(:filepath => "/path/to/the/puzzle/file.puz")
-- Or --
blob = open("/path/to/the/puzzle/file.puz", "r").read ac = Acrosslite.new(:content => blob)
Useful information about the puzzle can be retrieved with a handful of method calls.
=== Puzzle Meta
ac.title # -> Title of the puzzle ac.author # -> Author of the puzzle ac.copyright # -> Puzzle Copyright
=== Puzzle Content
ac.diagram # -> two-dimensional matrix of the diagram ac.solution # -> two-dimensional matrix of the solution
ac.rows # -> Number of rows ac.columns # -> Number of columns
Acrosslite::Entry objects are broken down thusly:
ac.direction - The direction the answer goes (across, down) ac.clue - The clue to provide an answer for ac.clue_number - Clue number represented by the little number in a crossword cell ac.row - What row the answer begins on (zero-based). ac.column - What column the answer begins on (zero-based). ac.length - The length of the answer ac.cell_number - The "physical" cell the answer begins on ac.answer - The answer
== Other
US Crossword Rules: http://www.maa.org/editorial/mathgames/mathgames_05_10_04.html
The rules for American crosswords are as follows:
== Acknowledgements
== Author
Samuel Mullen samullen@gmail.com
== Copyright
Copyright(c) 2010 Samuel Mullen (samullen). See LICENSE for details