Nautical bell: Difference between revisions

→‎{{header|J}}: improve comments in callWatch
(→‎{{header|J}}: general solution cleanup (tabluation, bug fixes, simplification of clock2ship))
(→‎{{header|J}}: improve comments in callWatch)
Line 272:
'watch bells' =. clock2ship y
NB. 1+bellsPlural becausefor 0~:bells ordinals are origin-1, not origin-0
NB. (and similarly 1+bells for notes).
fields=.(0{y);(1{y);(watch{::WATCH);(bells{::ORDINAL);('s'#~0~:bells)
notes =. ; (0 2#:1+bells) #&.> u:16b266b 16b266a NB. ♫♪
NB. Similarly, plural for 0~:bells
notes ;~ '%02d:%02d %s watch, %s Bell%s Gone: \t' sprintf fields
)
Anonymous user