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

Published on 12 May 2024 09:40 PM

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

Source code in the egel programming language

import "prelude.eg"
import "io.ego"

using System
using IO

def print_rhyme =
    [ 0 ->
        print "better go to the store, and buy some more\n"
    | N ->
        let _ = print N " bottles of beer on the wall\n" in
        let _ = print N " bottles of beer\n" in
        let _ = print "take one down, pass it around\n" in
            print_rhyme (N - 1) ]

def main = print_rhyme 99

  

You may also check:How to resolve the algorithm Rock-paper-scissors step by step in the Python programming language
You may also check:How to resolve the algorithm Multiple regression step by step in the Emacs Lisp programming language
You may also check:How to resolve the algorithm Extend your language step by step in the Go programming language
You may also check:How to resolve the algorithm URL encoding step by step in the zkl programming language
You may also check:How to resolve the algorithm Sieve of Eratosthenes step by step in the SETL programming language