public void singleCell_dissapear_afterStep() { var game = new ConwaysLife(10, 10, new FakeUi()); game.ReviveCells(new Point(1, 1)); game.Step(); Assert.AreEqual(0, game.GetAge(new Point(1, 1))); }
private static void Main(string[] args) { var ui = new ConsoleUi(20, 20); var game = new ConwaysLife(20, 20, ui); game.ReviveCells(glider); while (true) { Console.ReadKey(intercept:true); game.Step(); } }
private static void Main(string[] args) { var ui = new ConsoleUi(20, 20); var game = new ConwaysLife(20, 20, ui); game.ReviveCells(glider); while (true) { Console.ReadKey(intercept: true); game.Step(); } }
private static void Main(string[] args) { var ui = new ConsoleUi(20, 20); var game = new ConwaysLife(20, 20, ui); game.ReviveCells( new Point(5, 0), new Point(5, 2), new Point(6, 1), new Point(6, 2), new Point(7, 1)); while (true) { Console.ReadKey(intercept:true); game.Step(); } }
static void Main(string[] args) { var game = new ConwaysLife(20, 20, new ConsoleUi(20, 20)); game.SetAge(new Point(5, 0), 1); game.SetAge(new Point(6, 1), 1); game.SetAge(new Point(7, 1), 1); game.SetAge(new Point(6, 2), 1); game.SetAge(new Point(5, 2), 1); while (true) { game.Step(); Console.ReadKey(); } }
private static void Main(string[] args) { var ui = new ConsoleUi(20, 20); var game = new ConwaysLife(20, 20, ui); game.ReviveCells( new Point(5, 0), new Point(5, 2), new Point(6, 1), new Point(6, 2), new Point(7, 1)); while (true) { Console.ReadKey(intercept: true); game.Step(); } }
private static void Main(string[] args) { var ui = new ConsoleUi(20, 20); var game = new ConwaysLife(20, 20); game = game.ReviveCells(glider); ui.Update(game); while (true) { Console.ReadKey(intercept: true); var tuple = game.Step(); game = tuple.Item1; foreach (var i in tuple.Item2) { ui.Update(i.Key.X, i.Key.Y, i.Value); } } }