From c1a793216b742af26b86d7fc3f78ab16c7b61ad6 Mon Sep 17 00:00:00 2001 From: rr-ushang Date: Wed, 10 Oct 2018 19:25:43 -0400 Subject: [PATCH] Update Test.cs Since grille is always 1 or 0 using bool would be more effective, just a suggestion tho. --- Test.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Test.cs b/Test.cs index 4c406ec..d5da9ac 100644 --- a/Test.cs +++ b/Test.cs @@ -11,15 +11,16 @@ class Test { const int ITE = 300; const int regle = 62; static void Main (string [] args) { - int [] grille = new int [TAILLE]; + Bool [] grille = new Bool [TAILLE]; + // why not use a bool array instead as values are 0 / 1 int [] temp = new int [TAILLE]; Random r = new Random(); for (int i = 0 ; i < TAILLE ; i++) { if (r.NextDouble() > 0.5) - grille [i] = 1; + grille [i] = True; else - grille [i] = 0; + grille [i] = False; } //grille[150] = 1; afficherGrille(grille); @@ -27,7 +28,7 @@ static void Main (string [] args) { for (int j = 0 ; j < TAILLE ; j++) { temp [j] = calculEtatCellule(j,grille); } - grille = new int [TAILLE]; + grille = new Bool[TAILLE]; grille = temp; afficherGrille(grille); temp = new int [TAILLE];