How to resolve the algorithm 99 bottles of beer step by step in the OASYS programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm 99 bottles of beer step by step in the OASYS 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 OASYS programming language
Source code in the oasys programming language
class player {}
int count
property int dummy
method quit verbs {{quit}} {
quit
}
method beer verbs {{beer}} {
count = 99
while count {
print count
print " bottles of beer on the wall.\n"
print count
print " bottles of beer.\nTake one down and pass it around,\n"
count = count - 1
if count {
print count
print " bottles of beer on the wall.\n\n"
}
}
print "No more bottles of beer on the wall.\n"
}
method init {
player = create player
print "Type 'beer' for beer.\nType 'quit' to quit.\n"
}
You may also check:How to resolve the algorithm Brazilian numbers step by step in the BASIC programming language
You may also check:How to resolve the algorithm Barnsley fern step by step in the IS-BASIC programming language
You may also check:How to resolve the algorithm Jacobi symbol step by step in the Scheme programming language
You may also check:How to resolve the algorithm Best shuffle step by step in the PHP programming language
You may also check:How to resolve the algorithm Permutations/Rank of a permutation step by step in the Quackery programming language