Method: Grid#printBoard

Defined in:
lib/cem/cruzzles.rb

#printBoard(overlay = nil) ⇒ Object



580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
# File 'lib/cem/cruzzles.rb', line 580

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