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

Published on 12 May 2024 09:40 PM

How to resolve the algorithm 99 bottles of beer step by step in the Algae 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 Algae programming language

Source code in the algae programming language

# 99 Bottles of Beer on the Wall 
# in Algae 
# bottles.A 
for (i in 99:1:1) {
    if (i != 1) {
        printf("%d bottles of beer on the wall\n";i);
        printf("%d bottles of beer...\n";i);
        printf("you take on down and pass it around...\n");
        if ( i == 2) {
            printf("%d bottles of beer on the wall\n\n";i-1);
        else
            printf("%d bottles of beer on the wall\n\n";i-1);
        }
    else
       printf("1 bottle of beer on the wall\n");
       printf("1 bottle of beer...\n");
       printf("you take on down and pass it around..\n");
       printf("no more bottles of beer on the wall!\n\n");
    }
}

  

You may also check:How to resolve the algorithm Even or odd step by step in the Fortran programming language
You may also check:How to resolve the algorithm Grayscale image step by step in the JavaScript programming language
You may also check:How to resolve the algorithm Sorting algorithms/Shell sort step by step in the PHP programming language
You may also check:How to resolve the algorithm Cyclotomic polynomial step by step in the J programming language
You may also check:How to resolve the algorithm Unprimeable numbers step by step in the 11l programming language