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 Curry

Date:05/17/05
Author:Mike Gogulski
URL:n/a
Comments:1
Info:http://www-ps.informatik.uni-kiel.de/~mh/pakcs/curry
Score: (2.81 in 113 votes)
-- Curry version of 99 bottles
-- By Mike Gogulski <mike@gogulski.com> 21 March 2005
-- Curry compiler online:
--   http://www-ps.informatik.uni-kiel.de/~mh/pakcs/curryinput_c2p.cgi 
-- use "binge" as your main goal
 
binge = loop 99 0 where
  loop i j =
    if i > j then drink i >> loop (i - 1) j else done
  drink n =
    putStr (show n) >> putStr " bottle(s) of beer on the wall,\n" >>
    putStr (show n) >> putStr " bottle(s) of beer!\n" >>
    putStr "Take one down, pass it around,\n" >>
    putStr (show (n - 1)) >> putStr " bottle(s) of beer on the wall!\n"

Download Source | Write Comment

Alternative Versions

Comments

>>  barrym said on 03/29/10 06:02:54

barrym More lazy-ass "bottle(s)" code. C'mon Mike, give us a compliant
program. Geez Louise..........

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: