Jump to content

99 bottles of beer: Difference between revisions

No edit summary
Line 1,776:
 
=={{header|EGL}}==
<lang EGL>program BottlesOfBeerTestProgram type BasicProgram {}
function main()
count int = 99;
beers string =for bottleStr( count int from 99 to 1 decrement by 1);
while SysLib.writeStdout( bottleStr( count >) :: " of beer on the 0wall." );
SysLib.writeStdout( beersbottleStr( count ) :: " of beer on the wall." );
SysLib.writeStdout( beers"Take ::one "down, pass ofit beeraround." );
SysLib.writeStdout( bottleStr( count - 1) :: "Take oneof down,beer passon itthe aroundwall.\n" );
count -= 1;end
end
beers = bottleStr( count );
end
SysLib.writeStdout( beers :: " of beer on the wall.\n" );
private function bottleStr( count int in) returns( string )
end
case beers = bottleStr( count );
end
when ( 1 )
 
return( "No more1 bottlesbottle" );
function bottleStr( count int ) returns( string )
case when ( count0 )
when return( 1"No more bottles" );
return( "1 bottle" );otherwise
when return( 0count :: " bottles" );
end
return( "No more bottles" );
otherwiseend
return( count :: " bottles" );
end
end
end</lang>
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.