diff --git a/Sources/CoreLibrary/Plateau.cs b/Sources/CoreLibrary/Plateau.cs index 5e421d3..2081cf0 100644 --- a/Sources/CoreLibrary/Plateau.cs +++ b/Sources/CoreLibrary/Plateau.cs @@ -1,4 +1,5 @@ using CoreLibrary.Exceptions; +using System.Security.Cryptography; namespace CoreLibrary { @@ -7,8 +8,6 @@ namespace CoreLibrary /// public class Plateau { - private static Random random = new Random(); - private readonly Code codeSecret; private readonly Code?[] grille; private readonly IEnumerable[] indicateurs; @@ -62,7 +61,7 @@ namespace CoreLibrary for (int i = 0; i < tailleCode; ++i) { - codeSecret.AjouterJeton(new Jeton(couleurs[random.Next(couleurs.Length)])); + codeSecret.AjouterJeton(new Jeton(couleurs[RandomNumberGenerator.GetInt32(0, couleurs.Length)])); } }