Nautical bell: Difference between revisions

Nautical bell in FreeBASIC
m (→‎{{header|Phix}}: added syntax colouring, marked p2js compatible)
(Nautical bell in FreeBASIC)
Line 567:
08:30:00 : 1 bell
09:00:00 : 2 bells</pre>
 
<lang freebasic>Dim As Byte m = 0
For n As Byte = 0 To 23
If n = 23 Then
Print " 23" + ":30" + " = " + "7 bells"
Else
m += 1
Print ""; n Mod 23; ":30"; " ="; m; " bells"
End If
If n = 23 Then
Print " 00" + ":00" + " = " + "8 bells"
Else
m += 1
Print ""; (n Mod 23+1); ":00"; " ="; m; " bells"
If m = 8 Then m = 0
End If
Next n
Sleep</lang>
 
=={{header|Go}}==
2,123

edits