Skip to content

Instantly share code, notes, and snippets.

ericlippert / ambiguous.cs
Created Jan 20, 2022
Ambiguous interfaces
View ambiguous.cs
public interface I1<U>
void M(U i); // generic first
void M(int i);
public interface I2<U>
void M(int i);
void M(U i); // generic second
ericlippert / Life1978v1.cs
Created Feb 17, 2021
1978 BASIC Life line-by-line ported to C#
View Life1978v1.cs
// This is a line-for-line C# port of a 1978 BASIC implementation of Conway's Life;
// bugs are included as they were in the original program.
// See and
// for details.
using System;
using static System.Math;
public class Program
ericlippert / Combinations.cs
Last active Nov 29, 2020
Computing combinations of a sequence in C#
View Combinations.cs
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
// An immutable stack
// Note that the class is abstract with a private
// constructor; this ensures that only nested classes
// may be derived classes.