Jump to content

Nautical bell: Difference between revisions

no edit summary
(→‎{{header|Mathematica}}: Mark incorrect)
No edit summary
Line 1,258:
</pre>
 
=={{header|Ring}}==
<lang ring>
# Project : Nautical bell
# Date : 2017/12/26
# Author : Gal Zsolt (~ CalmoSoft ~)
# Email : <calmosoft@gmail.com>
 
m = 0
for n = 0 to 23
if n = 23
see "23" + ":30" + " = " + "7 bells" + nl
else
m = m + 1
see "" + n%23 + ":30" + " = " + m + " bells" + nl
ok
if n = 23
see "00" + ":00" + " = " + "8 bells" + nl
else
m = m + 1
see "" + (n%23+1) + ":00" + " = " + m + " bells" + nl
if m = 8
m = 0
ok
ok
next
</lang>
Output:
<pre>
0:30 = 1 bells
1:00 = 2 bells
1:30 = 3 bells
2:00 = 4 bells
2:30 = 5 bells
3:00 = 6 bells
3:30 = 7 bells
4:00 = 8 bells
4:30 = 1 bells
5:00 = 2 bells
5:30 = 3 bells
6:00 = 4 bells
6:30 = 5 bells
7:00 = 6 bells
7:30 = 7 bells
8:00 = 8 bells
8:30 = 1 bells
9:00 = 2 bells
9:30 = 3 bells
10:00 = 4 bells
10:30 = 5 bells
11:00 = 6 bells
11:30 = 7 bells
12:00 = 8 bells
12:30 = 1 bells
13:00 = 2 bells
13:30 = 3 bells
14:00 = 4 bells
14:30 = 5 bells
15:00 = 6 bells
15:30 = 7 bells
16:00 = 8 bells
16:30 = 1 bells
17:00 = 2 bells
17:30 = 3 bells
18:00 = 4 bells
18:30 = 5 bells
19:00 = 6 bells
19:30 = 7 bells
20:00 = 8 bells
20:30 = 1 bells
21:00 = 2 bells
21:30 = 3 bells
22:00 = 4 bells
22:30 = 5 bells
23:00 = 6 bells
23:30 = 7 bells
00:00 = 8 bells
</pre>
 
2,468

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.