How to resolve the algorithm 99 bottles of beer step by step in the Action! programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm 99 bottles of beer step by step in the Action! 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 Action! programming language
Source code in the action! programming language
PROC Bottles(BYTE i)
IF i=0 THEN
Print("No more")
ELSE
PrintB(i)
FI
Print(" bottle")
IF i#1 THEN
Print("s")
FI
RETURN
PROC Main()
BYTE i=[99]
WHILE i>0
DO
Bottles(i) PrintE(" of beer on the wall,")
Bottles(i) PrintE(" of beer,")
Print("Take ")
IF i>1 THEN
Print("one")
ELSE
Print("it")
FI
PrintE(" down and pass it around,")
i==-1
Bottles(i) PrintE(" of beer on the wall.")
IF i>0 THEN
PutE()
FI
OD
RETURN
You may also check:How to resolve the algorithm Sum of a series step by step in the Pascal programming language
You may also check:How to resolve the algorithm Sum multiples of 3 and 5 step by step in the Mathematica/Wolfram Language programming language
You may also check:How to resolve the algorithm Singly-linked list/Element insertion step by step in the JavaScript programming language
You may also check:How to resolve the algorithm Lucas-Lehmer test step by step in the Python programming language
You may also check:How to resolve the algorithm Rare numbers step by step in the Wren programming language