Nautical bell: Difference between revisions

No edit summary
Line 737:
words = ["One","Two","Three","Four","Five","Six","Seven","Eight"]
sound = "ding!"
 
def watch_name hr_min
idx = watch_ends.find_index {|t| hr_min <= t}
watches[idx]
end
 
loop do
Line 749 ⟶ 744:
num = 8 if num == 0
hr_min = time.strftime "%H:%M"
idx = watch_ends.find_index {|t| hr_min <= t}
text = "%s - %s watch, %s bell%s gone" % [
hr_min,
watch_name(hr_min)watches[idx],
words[num-1],
num==1 ? "" : "s"
Anonymous user