20 lines
626 B
Plaintext
20 lines
626 B
Plaintext
code = input("Enter HQ9+ program: ")
|
|
|
|
sing = function()
|
|
for i in range(99,2)
|
|
print i + " bottles of beer on the wall, " + i + " bottles of beer"
|
|
print "Take one down, pass it around, " + (i-1) + " bottle" + "s"*(i>2) + " of beer on the wall"
|
|
end for
|
|
print "1 bottle of beer on the wall, 1 bottle of beer"
|
|
print "Take one down, pass it around, no bottles of beer on the wall!"
|
|
end function
|
|
|
|
accumulator = 0
|
|
for c in code
|
|
c = c.lower
|
|
if c == "h" then print "Hello World"
|
|
if c == "q" then print code
|
|
if c == "9" then sing
|
|
if c == "+" then accumulator = accumulator + 1
|
|
end for
|