fix of random
continuous-integration/drone/push Build is passing Details

test_old_branch
Jérémy Mouyon 12 months ago
parent 3044de9796
commit c87148aa78

@ -5,6 +5,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Xml.Linq; using System.Xml.Linq;
using System.Security.Cryptography;
namespace QwirkleClassLibrary namespace QwirkleClassLibrary
{ {
@ -82,8 +83,7 @@ namespace QwirkleClassLibrary
{ {
for (int j = 0; j < 6; j++) for (int j = 0; j < 6; j++)
{ {
Random random = new Random(); int val = RandomNumberGenerator.GetInt32(0, bag.TilesBag.Count);
int val = random.Next(0, bag.TilesBag.Count);
p.AddTileToPlayer(bag.TilesBag[val]); p.AddTileToPlayer(bag.TilesBag[val]);
bag.RemoveTileInBag(bag.TilesBag[val]); bag.RemoveTileInBag(bag.TilesBag[val]);

Loading…
Cancel
Save