Language Polyphonic C#
| Date: | 08/21/08 |
| Author: | Halo_Four |
| URL: | n/a |
| Comments: | 0 |
| Info: | http://research.microsoft.com/~nick/polyphony/ |
| Score: |
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
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!
Comments