Jump to content

99 bottles of beer: Difference between revisions

Add an ATS implementation. My own work.
(added TI-83 BASIC)
(Add an ATS implementation. My own work.)
Line 248:
X>17 ? "on the wall", (X>1 ? "on the bwall", "in the buttle")
}</lang>
 
=={{header|ATS}}==
<lang ATS>/* .<n>. is a termination metric to prove that the function terminates. It can be omitted. */
fun bottles {n:nat} .<n>. (n: int n): void =
if n = 0 then
()
else begin
printf ("%d bottles of beer on the wall\n", @(n));
printf ("%d bottles of beer\n", @(n));
printf ("Take one down, pass it around\n", @());
printf ("%d bottles of beer on the wall\n", @(n-1));
bottles (n - 1)
end
 
implement main () = bottles (99)</lang>
 
=={{header|AutoHotkey}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.