This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Comparable | |
def not_below(n) self < n ? n : self ; end | |
def not_above(n) self > n ? n : self ; end | |
end | |
class BoggleBoard | |
attr_reader :width, :height, :vert_range, :horiz_range, :diag_range | |
def initialize(grid) | |
@width , @height = grid.first.length , grid.length | |
raise ArgumentError.new("BoggleBoard needs rectangular array of one-char strings." | |
) unless ( @width > 0 && @height > 0 && |