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 Ada

(standard version)

Date:04/20/05
Author:Gautier de Montmollin
URL:n/a
Comments:3
Info:n/a
Score: (3.02 in 122 votes)
-- Ada version of 99 Bottles of Beer

with Ada.Text_IO;         use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;

procedure Bottles is

  count : Integer := 99;

begin
  while count > 0 loop
    Put (count, Width=>0);  Put_Line (" bottles of beer on the wall,");
    Put (count, Width=>0);  Put_Line (" bottles of beer.");
    Put_Line ("Take one down and pass it around.");
    count := count - 1;
    if count = 0 then
      Put_Line("No bottles of beer on the wall!");
    else
      Put (count, Width=>0);  Put_Line (" bottles of beer on the wall.");
    end if;
    New_Line;
  end loop;
end Bottles;

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
multitaskingtmoran[at]bix[dot]com04/20/050

Comments

>>  David Short. said on 09/14/08 12:13:18

David Short. This fails to compile.

>>  Pez said on 09/24/08 14:02:21

Pez Compiles just fine on gcc 4.3 with the Ada frontend. Just tested on opensuse.

>>  Harald Arnesen said on 04/17/09 20:38:46

Harald Arnesen "1 bottles of beer"?

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: