overmapper.rb
def parse_notes(path)
  notes = Array.new
  File.open(path) do |fh|
    fh.each_line do |line|
      next unless line.match(/L #{@conf[:level]}/)
      3.times { fh.readline }
      break
    end
    fh.each_line do |line|
      break unless m = line.match(/N (\d+) (\d+)/)
      x, y = m.captures.map(&:to_i)
      n = parse_note(fh.readline.chop)
      n.x = x
      n.y = y
      notes.push(n)
    end
  end
  notes
end
# Extract chosen level notes from a seen file
Extract chosen level notes from a seen file
Extract chosen level notes from a seen file
def parse_notes(path)
  notes = Array.new
  File.open(path) do |fh|
    fh.each_line do |line|
      next unless line.match(/L #{@conf[:level]}/)
      3.times { fh.readline }
      break
    end
    fh.each_line do |line|
      break unless m = line.match(/N (\d+) (\d+)/)
      x, y = m.captures.map(&:to_i)
      n = parse_note(fh.readline.chop)
      n.x = x
      n.y = y
      notes.push(n)
    end
  end
  notes
end
def parse_notes ( path ) notes = Array . new File . open ( path ) do | fh | fh . each_line do | line | next unless line . match ( / L  #{ @conf [ :level ] } / ) 3 . times { fh . readline } break end fh . each_line do | line | break unless m = line . match ( / N ( \d +) ( \d +) / ) x , y = m . captures . map ( & :to_i ) n = parse_note ( fh . readline . chop ) n . x = x n . y = y notes . push ( n ) end end notes end
Extract chosen level notes from a seen file
Extract chosen level notes from a seen file
path