static void Main(string[] args) { Conway world = new Conway(20); for (int i = 0; i < 3; i++) { world.Evolve(); Console.WriteLine(); world.PrintToConsole(); } Console.ReadKey(); }
public static void PrintToConsole(this Conway conway) { for (int x = 0; x < conway.World.GetLength(0); x++) { string row = string.Empty; for (int y = 0; y < conway.World.GetLength(1); y++) { row += $" {conway.World[x, y].ToString()}"; } Console.WriteLine(row); } }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { conway = new Conway(400, 400); cameraPosition = Vector2.Zero; base.Initialize(); }