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 OCaml

(historic version)

Date:04/20/05
Author:Philipp Winterberg
URL:http://www.winterbergs.de/
Comments:0
Info:http://caml.inria.fr/ocaml/distrib.html
Score: (1.41 in 22 votes)
(* Objective Caml version of 99 Bottles of beer (Bottles.ml) *)
(* http://caml.inria.fr/ocaml/distrib.html                   *)
(* Philipp Winterberg, http://www.winterbergs.de             *)

let b = ref 99
in while !b > 0 do
     print_int !b; print_string " bottle(s) of beer on the wall,\n";
     print_int !b; print_string " bottle(s) of beer.\n";
     print_string "Take one down, pass it around,\n";
     b := !b - 1;
     print_int !b; print_string " bottle(s) of beer on the wall.\n\n"
  done;;

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
working with new versions, using printfDavid Baelde11/08/050
functional versionAnonymous04/20/050
A little modification to the current onePhilippe Wang01/28/061
version with recursive variant typePierre Etchemaïté11/18/051

Comments

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: