function a($)
Dim $W
$ = 1 * $
$W = ' on the wall'
$a = W($)
$a = chr(asc($a)-32) + Right($a, ~) + $W + ', ' + $a + '.'
If $
$a = $a + ' Take one down and pass it around, ' + W($ - 1) + $W + '.'
Else
$a = $a + ' Go to the store and buy some more, ' + W(99) + $W + '.'
endfunction
Function W($)
dim $b
$b="no more",one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thirteen,fourteen,fifteen,sixteen,seventeen,eighteen,nineteen,twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety
if $<20
$w=$b[$]
else
$w= $b[18+ $/10]
if $ mod 10
$w=$w + "-" + $b[$ mod 10]
endif
endif
$W = $W + ' bottle' + IIf($ = 1, @, s) + ' of beer'
EndFunction