public class CaptureExample
{

    delegate void VoidFunction();
    static VoidFunction haha;

    delegate int IntGetter();
    static IntGetter getCount;

    static void tryCapture()
    {
        int laughCount = 0;
        haha = delegate { laughCount++; };
        getCount = () => laughCount;
    }

    public static void Main()
    {
        tryCapture();
        for (int i = 1; i <= 200; ++i) haha();
        Console.WriteLine("Count stands at {0}", getCount());
    }
}
