This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 https://ericlippert.com/2021/02/17/life-part-38/ and | |
// https://ericlippert.com/2021/02/23/life-part-39/ for details. | |
using System; | |
using static System.Math; | |
public class Program | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |