Esempio n. 1
0
        public IEnumerable <Cell <State> > Neighbors(Cell <State> cell)
        {
            var neighbors_position = Neighborhood.Neighbors(cell.Position);

            return(neighbors_position
                   .Select(PositionToIndex)
                   .Select(Cells.ElementAt));
        }
Esempio n. 2
0
 public Cell Apply(Neighborhood neighborhood)
 {
     return(killerNeighborhoods.Contains(neighborhood) ? Cell.Death : Cell.Alive);
 }