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 Irken

(More Irken-like, less Scheme-like)

Date:01/27/12
Author:Sam Rushing
URL:n/a
Comments:0
Info:http://github.com/samrushing/irken-compiler
Score: (3.00 in 2 votes)
;; -*- Mode: Irken -*-

;; https://github.com/samrushing/irken-compiler

(include "lib/core.scm")
(include "lib/pair.scm")
(include "lib/string.scm")

(define B
  0 -> "no more bottles"
  1 -> "1 bottle"
  x -> (format (int x) " bottles")
  )

(for-range
    i 99
    (let ((n (- 99 i)))
      (print-string
       (format (B n) " of beer on the wall, " (B n) " of beer.\n"
	       "Take one down and pass it around, "
	       (B (- n 1)) " of beer on the wall.\n\n"))))

(print-string "No more bottles of beer on the wall, no more bottles of beer.\n")
(print-string "Go to the store and buy some more, 99 bottles of beer on the wall.\n")

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
1Mike Gogulski03/03/110

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: