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 Logo

(correct lyrics, recursion)

Date:03/17/08
Author:rahul
URL:http://code.google.com/p/v-language/
Comments:1
Info:http://www.softronix.com/logo.html
Score: (3.00 in 28 votes)
to bottle :i
    if :i = 0 [output [No more bottles of beer]]
    if :i = 1 [output [One bottle of beer]]
    output se :i [bottles of beer]
end

to verse :i
    pr (se bottle :i [ on the wall,] bottle :i)
    pr [Take one down, pass it around]
    pr se bottle :i - 1 [ on the wall]
end

to sing :i
    if :i = 0 [stop]
    verse :i
    sing :i - 1
end

#Using it:
sing 99

Download Source | Write Comment

Alternative Versions

Comments

>>  JD said on 04/21/08 08:04:18

JD This code fails to remind us to go to the store and refill our cooler. Bummer.

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: