Class: InteractiveTerm::Bitmap

Inherits:
Object
  • Object
show all
Defined in:
lib/interactive_term.rb

Overview

TODO: Bitmap should accept array of strings as well as array of array of chars (length one strings)

Class Method Summary collapse

Class Method Details

.iterate(bitmap, &block) ⇒ Object



108
109
110
111
112
113
114
115
116
117
118
# File 'lib/interactive_term.rb', line 108

def self.iterate(bitmap, &block)
  y = 0
  bitmap.each do |str|
    x = 0
    str.each_char do |char|
      yield char, x, y
      x += 1
    end
    y += 1
  end
end