Voting

Category

real language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language Turbo Pascal

(for Windows)

Date:04/20/05
Author:Philipp Winterberg
URL:http://www.winterbergs.de/
Comments:2
Info:n/a
Score: (2.82 in 17 votes)
{ Turbo Pascal for Windows version of 99 Bottles of beer (Bottles.pas) }
{ Philipp Winterberg, http://www.winterbergs.de }

program Bottles;

uses wincrt;
var b: byte;

function plural(anz_flaschen: byte): string;
begin
  if anz_flaschen <> 1
    then plural:= 's'
    else plural:= ''
end; {plural}

begin
  screensize.y:= 1 + 99 * 5;
  inactivetitle:= ' 99 Bottles of beer ';
  initwincrt;
  for b:=99 downto 1 do
    begin
      writeln(b :2, ' bottle' + plural(b) + ' of beer on the wall, ');
      writeln(b :2, ' bottle' + plural(b) + ' of beer.');
      writeln('Take one down, pass it around,');
      writeln((b-1) :2, ' bottle' + plural(b-1) + ' of beer on the wall.');
      writeln
    end
end. {Bottles}

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
for DOSPhilipp Winterberg04/20/052

Comments

>>  MOSFET said on 04/20/08 15:53:00

MOSFET :) Nice

>>  StiKule said on 12/13/08 15:13:09

StiKule It doesn't run under borland 7.0 ...
There is no window mode, so you can replace wincrt by crt, or delete it and delete :

screensize.y:= 1 + 99 * 5;
inactivetitle:= ' 99 Bottles of beer ';
initwincrt;

It runs only for TPW : Turbo Pascal for Windows

Download Source | Write Comment

Add Comment

Please provide a value for the fields Name, Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.

Please don't post large portions of code here! Use the form to submit new examples or updates instead!

Name:

eMail:

URL:

Security Code:
  
Comment: