How to resolve the algorithm 99 bottles of beer step by step in the Comal programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm 99 bottles of beer step by step in the Comal 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 Comal programming language
Source code in the comal programming language
0010 DIM itone$(0:1)
0020 itone$(0):="one";itone$(1):="it"
0030 FOR b#:=99 TO 1 STEP -1 DO
0040 bottles(b#)
0050 PRINT "of beer on the wall,"
0060 bottles(b#)
0070 PRINT "of beer,"
0080 PRINT "Take ",itone$(b#=1)," down and pass it around,"
0090 bottles(b#-1)
0100 PRINT "of beer on the wall!"
0110 PRINT
0120 ENDFOR b#
0130 PROC bottles(b#) CLOSED
0140 CASE b# OF
0150 WHEN 0
0160 PRINT "No more bottles ",
0170 WHEN 1
0180 PRINT "1 bottle ",
0190 OTHERWISE
0200 PRINT b#," bottles ",
0210 ENDCASE
0220 ENDPROC bottles
0230 END
You may also check:How to resolve the algorithm Variables step by step in the Mercury programming language
You may also check:How to resolve the algorithm Greatest common divisor step by step in the Modula-2 programming language
You may also check:How to resolve the algorithm Percolation/Mean run density step by step in the C programming language
You may also check:How to resolve the algorithm Apply a callback to an array step by step in the FutureBasic programming language
You may also check:How to resolve the algorithm Narcissist step by step in the UNIX Shell programming language