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 Rebol

(series functions)

Date:06/22/10
Author:Nicolas
URL:n/a
Comments:1
Info:http://re-bol.com
Score: (3.00 in 8 votes)
REBOL []

s: [
	99 	;1
	" bottles of beer" ;2
	" on the wall"	;3
	", " 	;4
	".^/"	;5
	"Take one down and pass it around, "	;6
	98	;7
	" bottle of beer"	;8
	"no more"	;9
	"No more"	;10
	"Go to the store and buy some more, "	;11
	99	;12
]

sequence: [
	[1 2 3 4  1 2 5  6 7 2 3 5]	;97 times
	[1 2 3 4  1 2 5  6 7 8 3 5]
	[1 8 3 4  1 8 5  6 9 2 3 5]
	[10 2 3 4  9 2 5  11 12 2 3 5]
]

drink: does [print "" s/1: s/1 - 1 s/7: s/7 - 1]
loop 97 [ foreach n sequence/1 [prin pick s n] drink ]	
foreach seq next sequence [	foreach n seq [prin pick s n] drink ]		
halt

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
1Anonymous04/20/051
Generalized song dialectGregg Irwin07/06/051
network readNicolas06/22/100

Comments

>>  barrym said on 07/10/10 06:21:28

barrym It has the four 'c's. Clean, compact, concise, correct. Nice example, Nicolas!

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: