Anonymous user
Nautical bell: Difference between revisions
→{{header|Ruby}}
No edit summary |
|||
Line 737:
words = ["One","Two","Three","Four","Five","Six","Seven","Eight"]
sound = "ding!"
idx = watch_ends.find_index {|t| hr_min <= t}▼
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,
words[num-1],
num==1 ? "" : "s"
|