def boolean_groups(reload=false)
      if two_dimensional?
        encoding(reload).map do |line|
          line.scan(/1+|0+/).map do |group|
            [group[0,1] == '1', group.size]
          end
        end
      else
        encoding(reload).scan(/1+|0+/).map do |group|
          [group[0,1] == '1', group.size]
        end
      end
    end
def boolean_groups(reload=false)
      if two_dimensional?
        encoding(reload).map do |line|
          line.scan(/1+|0+/).map do |group|
            [group[0,1] == '1', group.size]
          end
        end
      else
        encoding(reload).scan(/1+|0+/).map do |group|
          [group[0,1] == '1', group.size]
        end
      end
    end
Collects continuous groups of bars and spaces (1 and 0)
into arrays where the first item is true or false (1 or 0)
and the second is the size of the group

For example, "1100111000" becomes [[true,2],[false,2],[true,3],[false,3]]