99 Bottles of Beer
One program in 571 languages
 
     
  Submit new example     Change log     History     Links     Tip: internet.ls-la.net     Thanks, Oliver     Guestbook      
Choose languages starting with letter:
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
QBasic   Quest ASL   Quick BASIC   Quikcode  
 
  Programming language: QBasic
 

' "99 Bottles of Beer on the Wall" QBasic / Perl Polyglot            '.
' Copyright (C) 2000 Jeff Connelly <polyglotqbperl@xyzzy.cjb.net>    '.
' May be freely distributed                                          '.
'                                                                    '.

' Probably only works in DOS.  You can get QBasic 1.1 with DOS, or   '.
' on the World Wide Web at http://www.neozones.com/ .                '.
' Note that QBasic reformats source code as it is opened; so do not  '.
' save this file inside QBasic if you want it to be parsed by Perl.  ';

'';sub function{}sub st{}
function st$(x1, y!, m$)
st$ = ltrim$(str$(y!))
end function
'!;

m%=99'%;$STATIC=9x2;
do
'NUL'; do {
    print st$(x1,m%-0%,z.$); '',print"\cH"x3;print
    '',$STATIC;
    print " bottles of beer on the wall";
    print ''; print "\n"x2; <<;
    print


    print st$(x1,m%-0%,z.$); '',print"\cH"x3;print
    '',$STATIC; 
    print " bottles of beer on the wall,";
    print ''; print "\n";

    print st$(x1,m%-0%,z.$); '',print"\cH"x3;print
    '',$STATIC;
    print " bottles of beer,";
    print '' and print "\n";


    print "Take one down, pass it around,";
    print ""; ''; print "\n";
    ''; <<;
    print


    ''; --$STATIC;
    m%=m%-1+foo.


''}  until $STATIC == 0 or !<<;;
loop until m%=0'%-1

system
 
  Programming language: Quest ASL
 
define game <99 Bottles of Beer>
   asl-version <300>
   game author <Alex Warren>
   start <room>
end define

define room <room>
   description {
      for <bottles; 99; 1; -1> {
         msg <%bottles% $name(%bottles%)$ of beer on the wall, %bottles% $name(%bottles%)$ of beer,>
         msg <Take one down and pass it around,>
	 set numeric <remaining; %bottles% - 1>
	 msg <%remaining% $name(%remaining%)$ of beer on the wall.|n>
      }
   }
end define

define function <name>
   if ( $parameter(1)$ = 1 ) then return <bottle> else return <bottles>
end define
 
  Programming language: Quick BASIC
 
'99 Bottles of Beer on the Wall
'Patrick Fleming   http://chem-www.mps.ohio-state.edu/~pfleming/

CLS

n = 100
DO UNTIL n = 1
     n = n - 1
     PRINT n; "bottle";
     IF n <> 1 THEN PRINT "s";
     PRINT " of beer on the wall . . ."
     PRINT n; "bottle";
     IF n <> 1 THEN PRINT "s";
     PRINT " of beer!"
     PRINT "Take one down, pass it around . . ."
     PRINT n - 1; "bottle";
     IF n - 1 <> 1 THEN PRINT "s";
     PRINT " of beer on the wall!"
     PRINT
LOOP

END
 
  Programming language: Quikcode
 
* Quikcode version of 99 Bottles of beer (Bottles.q)
* See http://www.quikcode.bizland.com/
* Philipp Winterberg, http://www.winterbergs.de

equate b wst1-2-I
move 99 to b
loop:
  display b ' bottle(s) of beer on the wall,'
  display b ' bottle(s) of beer.'
  display 'Take one down, pass it around,'
  subtract 1 from b
  display b ' bottle(s) of beer on the wall.'
  display
  if b < 1 
    go to done
  else
    go to loop
done: end.
 
  © Oliver Schade <os@ls-la.net>, Generated: 06.06.2003 17:38:32