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

Published on 12 May 2024 09:40 PM

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

Source code in the tuscript programming language

$$ MODE TUSCRIPT
LOOP bottle=1,100
SET bottlenr=100-bottle
IF (bottlenr==0) THEN
PRINT "no bottle of beer on the wall"
EXIT
ELSEIF (bottlenr==1) THEN
PRINT bottlenr, " bottle of beer on the wall"
PRINT bottlenr, " bottle of beer"
ELSE
PRINT bottlenr, " bottles of beer on the wall"
PRINT bottlenr, " bottles of beer"
ENDIF
PRINT "Take one down, pass it around"
ENDLOOP

  

You may also check:How to resolve the algorithm 99 bottles of beer step by step in the LDPL programming language
You may also check:How to resolve the algorithm Box the compass step by step in the ALGOL 68 programming language
You may also check:How to resolve the algorithm Old lady swallowed a fly step by step in the Elixir programming language
You may also check:How to resolve the algorithm Active Directory/Search for a user step by step in the Scala programming language
You may also check:How to resolve the algorithm Return multiple values step by step in the Lily programming language