|
' "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
|
|
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
|
|
* 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.
|