Public feed
#893478
/*
* Created by SharpDevelop.
* User: matty
* Date: 6/02/2008
* Time: 2:29 PM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections.Generic;
namespace ClosureFun
{
class Program
{
public delegate void Func();
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
// TODO: Implement Functionality Here
List<Func> list = new List<Func>();
FunLoop(0,list);
foreach(Func f in list)
{
f();
}
}
public static void FunLoop(int i,List<Func> list)
{
if(i > 100) return;
Func foo = delegate()
{
Console.WriteLine(i.ToString());
};
list.Add(foo);
FunLoop(i+1,list);
}
}
}