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

Published on 12 May 2024 09:40 PM

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

Source code in the emacs programming language

(let ((i 99))
  (while (> i 0)
    (message "%d bottles of beer on the wall" i)
    (message "%d bottles of beer" i)
    (message "Take one down, pass it around")
    (message "%d bottles of beer on the wall" (1- i))
    (setq i (1- i))))


  

You may also check:How to resolve the algorithm Return multiple values step by step in the ALGOL 68 programming language
You may also check:How to resolve the algorithm Sort stability step by step in the Perl programming language
You may also check:How to resolve the algorithm Amicable pairs step by step in the VBScript programming language
You may also check:How to resolve the algorithm Hostname step by step in the REBOL programming language
You may also check:How to resolve the algorithm MAC vendor lookup step by step in the Racket programming language