Method: Grid#printBoard

Defined in:
lib/cem/cruzzles.rb

#printBoard(overlay = nil) ⇒ Object



539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
# File 'lib/cem/cruzzles.rb', line 539

def printBoard(overlay = nil)

  result = ""
  @data.each_with_index { |l, y|
    l.each_with_index { |c, x|
     
      if overlay 
        pos = Point2D.new(x,y)
        if overlay.has_key?(pos)
          result += overlay[pos]
        end
        next
      else
        result += c.to_s
      end
    }
    
    result += "\r\n"
  }
  return result
end