ReadMe

Path: ReadMe
Last Update: Mon Jan 17 22:33:57 CST 2005

WordFind

WordFind — library to generate WordFind puzzles

Synopsis

  require 'wordfind'

  words = %w< Ruby Perl Erlang Io Python >
  puzzl = WordFind.new(words)
  puzzl.add_word('quux')
  puzzl.create
  print puzzl.to_s
  __END__

        Words to Find:
        --------------

        ERLANG  IO      PERL
        PYTHON  QUUX    RUBY

        I F G S U B D Y L I
        Q X V I P L K K U J
        W A I I T E Y D E T
        G A P B M M R G U L
        M N O H T Y P L T N
        Q D A I F O I G M K
        V U C L T R I M K Z
        B Z U L R R U B Y L
        L O V X C E M R X M
        V G C L H C Z F S L

Description

Simply provides a class which can be used to generate WordFind type puzzles. The API is simple:

API

  • puzzle = WordFind.new(word_list, options={})
    • :size => N — sets matrice size to NxN
    • :intersect => 1 — allows words to intersect (share letters)
    • :only => [directections] — words must be oriented in the given compass directions
    • :no => [directions] — disallows given word orientations
  • puzzle.create — generates the puzzle / solution
  • puzzle.to_s — prints a plain-text version of the puzzle

Author

Copyright © Andrew L Johnson 2005

[Validate]