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 Factor

(Factor 0.83)

Date:08/23/06
Author:John Kimber
URL:n/a
Comments:0
Info:http://factorcode.org/
Score: (3.03 in 204 votes)
IN: 99bottles
USING: sequences kernel prettyprint io namespaces math ;
	
: verse
	 dup dup pprint " bottles of beer on the wall, " write
		pprint  " bottles of beer." print
		"Take one down and pass it around, " write
		1- pprint " bottles of beer on the wall." print	terpri
		;

: verses-99-2  
	2 100 <reversed> head-slice* [ verse ] each ;
		
: verse-1
	 "1 bottle of beer on the wall, 1 bottle of beer." print
		"Take one down and pass it around, no more bottles of beer on the wall." print terpri
		;
		
: verse-0
	"No more bottles of beer on the wall, no more bottles of beer." print
		"Go to the store and buy some more, 99 bottles of beer on the wall." print terpri
		;
		
	verses-99-2
	verse-1
	verse-0

Download Source | Write Comment

Alternative Versions

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: