[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Oct 30 12:07:30 1995 
Subject:Re: Pop Beer Needed 
From:John Williams 
Volume-ID:951031.02 

Tim Robinson writes:

>I have a web page that shows how to display the lyrics to 99 Bottles of Beer
>in different programming languages (full explanation of this silly thing found
>on the web page).  However, I lack a version in Pop.

Ok, here's a version using LIB * FORMAT_PRINT (Pop-11's implementation of the
Common Lisp function FORMAT):


 true -> pop_longstrings;

 define beer(n);
     until n == 0 do
         format_print(
             '~@(~R~) bottle~:P of beer on the wall.~%~
              ~:*~@(~R~) bottle~:P of beer!~%~
              ~:*Take ~[~;it~:;one~] down, pass it around.~%',
             [^n]);
         n - 1 -> n;
         format_print('~[No~:;~:*~@(~R~)~] more bottle~:P of beer on the wall.~2%', [^n])
     enduntil
 enddefine;

 beer(99);


The nice thing about this is that the numbers are printed as words, i.e.
"Ninety-nine bottles of beer".