class Wordsearch

Constants

VERSION

Public Class Methods

new(dictionary=ENV["ANAGRAM_DICT"]) click to toggle source
# File lib/wordsearch.rb, line 5
def initialize(dictionary=ENV["ANAGRAM_DICT"])
  @dict = dictionary
end

Public Instance Methods

an(p1) click to toggle source
VALUE an(VALUE self, VALUE pattern) {
  const char *pat = StringValueCStr(pattern);
  an_main(pat, dictfile(self), wsYield);
  return Qnil;
}
anagrams(pattern, &block) click to toggle source
# File lib/wordsearch.rb, line 9
def anagrams(pattern, &block)
  an(pattern, &block)
end
cr(p1) click to toggle source
VALUE cr(VALUE self, VALUE pattern) {
  const char *pat = StringValueCStr(pattern);
  fw_main(pat, dictfile(self), 1, wsYield);
  return Qnil;
}
find_words(pattern, &block) click to toggle source
# File lib/wordsearch.rb, line 13
def find_words(pattern, &block)
  fw(pattern, &block)
end
fw(p1) click to toggle source
VALUE fw(VALUE self, VALUE pattern) {
  const char *pat = StringValueCStr(pattern);
  fw_main(pat, dictfile(self), 0, wsYield);
  return Qnil;
}
solve_cryptogram(pattern, &block) click to toggle source
# File lib/wordsearch.rb, line 17
def solve_cryptogram(pattern, &block)
  cr(pattern, &block)
end