Voting

Category

esoteric language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language Polyphonic C#

Date:08/21/08
Author:Halo_Four
URL:n/a
Comments:0
Info:http://research.microsoft.com/~nick/polyphony/
Score: (3.00 in 1 votes)
using System;

class Program {
	static async Bottle(int id);
	static async NoMore();
	
	static bool Stanza() & Bottle(int id) {
		Console.WriteLine("{0} bottle{1} of beer on the wall, {0} bottle{1} of beer", id, id != 1 ? "s" :
"");
		Console.Write("Take one down and pass it around, ");
		if(id == 1) {
			Console.WriteLine("no more bottles of beer on the wall");
			NoMore();
		}
		else {
			id--;
			Console.WriteLine("{0} bottle{1} of beer on the wall", id, id != 1 ? "s" : "");
			Bottle(id);
		}
		return true;
	}
	& NoMore() {
		Console.WriteLine("No more bottles of beer on the wall, no more bottles of beer");
		Console.WriteLine("Go to the store and buy some more, 99 bottles of beer on the wall");
		return false;
	}
	
	static async Sing() {
		while(Stanza());
	}

	static void Main() {
		Bottle(99);
		Sing();
		Console.ReadLine();
	}
}

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: