watches = [ , , , , , , ,  ]
watch_ends = [ , , , , , , ,  ]
words = [,,,,,,,]
sound = 

loop do
  time = Time.now
  if time.sec == 0 and time.min % 30 == 0
    num = (time.hour * 60 + time.min) / 30 % 8
    num = 8 if num == 0
    hr_min = time.strftime 
    idx = watch_ends.find_index {|t| hr_min <= t}
    text =  % [
        hr_min, 
        watches[idx], 
        words[num-1], 
        num==1? : 
    ]
    bells = (sound * num).gsub(sound + sound) {|dd| dd + ' '}
    puts  % [text, bells]
  end
  sleep 1
end