diff --git a/SharpPropagation/Program.cs b/SharpPropagation/Program.cs index af16d8f..f01baae 100644 --- a/SharpPropagation/Program.cs +++ b/SharpPropagation/Program.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Threading; +using System.IO; namespace SharpPropagation { @@ -17,9 +18,15 @@ namespace SharpPropagation Size populationSize = new Size(1000,1000); Population peoples = new Population(populationSize,random,10,10,5); peoples.SetDisease(new Disease(random,20,10,5,"Chick Chicken")); - string ImagesLocation = "Test/"; + string ImagesLocation = "./Test/"; //peoples.Display(); - + + // If the directory does not exist, create it + if (!Directory.Exists(ImagesLocation)) + { + Directory.CreateDirectory(ImagesLocation); + } + Console.WriteLine($"Propagation started with {populationSize.Width} x {populationSize.Height} humans ({populationSize.Width*populationSize.Height})"); int[] stats; int steps = 0;