How to resolve the algorithm 99 bottles of beer step by step in the Klong programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm 99 bottles of beer step by step in the Klong programming language

Table of Contents

Problem Statement

Display the complete lyrics for the song:     99 Bottles of Beer on the Wall.

The lyrics follow this form: ... and so on, until reaching   0     (zero). Grammatical support for   1 bottle of beer   is optional. As with any puzzle, try to do it in as creative/concise/comical a way as possible (simple, obvious solutions allowed, too).

Let's start with the solution:

Step by Step solution about How to resolve the algorithm 99 bottles of beer step by step in the Klong programming language

Source code in the klong programming language

bottles::{:[x=1;"bottle";"bottles"]}
itone::{:[x=1;"it";"one"]}
numno::{:[x=0;"no";x]}
drink::{.d(numno(x));
	.d(" ");
	.d(bottles(x));
	.p(" of beer on the wall");
	.d(numno(x));
	.d(" ");
	.d(bottles(x));
	.p(" of beer");
	.d("take ");
	.d(itone(x));
	.p(" down and pass it round");
	.d(numno(x-1));
	.d(" ");
	.d(bottles(x-1));
	.p(" of beer on the wall");.p("")}
drink'1+|!99

  

You may also check:How to resolve the algorithm File input/output step by step in the Octave programming language
You may also check:How to resolve the algorithm Fusc sequence step by step in the Julia programming language
You may also check:How to resolve the algorithm Probabilistic choice step by step in the Factor programming language
You may also check:How to resolve the algorithm Matrix chain multiplication step by step in the Phix programming language
You may also check:How to resolve the algorithm Define a primitive data type step by step in the Raku programming language