class WordSearch::Plane::Base

Constants

LETTERS

Attributes

catalog[RW]
x[RW]
y[RW]

Public Instance Methods

add_letters() { |x_point, y_point| ... } click to toggle source
# File lib/word_search/plane/base.rb, line 30
def add_letters
  x.times do |x_point|
    y.times do |y_point|
      yield(x_point, y_point)
    end
  end
end
directions() click to toggle source
# File lib/word_search/plane/base.rb, line 54
def directions
  raise NotImplementedError
end
letter_at(*positions) click to toggle source
# File lib/word_search/plane/base.rb, line 58
def letter_at(*positions)
  dig(*positions)
end
max() click to toggle source
# File lib/word_search/plane/base.rb, line 50
def max
  raise NotImplementedError
end
print(file_name = nil) click to toggle source
pto_s() click to toggle source
# File lib/word_search/plane/base.rb, line 38
def pto_s
  puts to_s
end
random_letter() click to toggle source
# File lib/word_search/plane/base.rb, line 18
def random_letter
  LETTERS.sample
end
three_dimensional?() click to toggle source
# File lib/word_search/plane/base.rb, line 26
def three_dimensional?
  false
end
to_s() click to toggle source
# File lib/word_search/plane/base.rb, line 42
def to_s
  raise NotImplementedError
end
total_points() click to toggle source
# File lib/word_search/plane/base.rb, line 46
def total_points
  raise NotImplementedError
end
two_dimensional?() click to toggle source
# File lib/word_search/plane/base.rb, line 22
def two_dimensional?
  true
end

Private Instance Methods

initialize_plane() { |x_point, y_point| ... } click to toggle source
# File lib/word_search/plane/base.rb, line 64
def initialize_plane
  x.times do |x_point|
    self[x_point] = {}
    y.times do |y_point|
      yield(x_point, y_point)
    end
  end
end