mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Use exclusive random for the mines board
This commit is contained in:
@@ -181,7 +181,7 @@ public class KasinoMines
|
|||||||
else coordsCounter = Mines;
|
else coordsCounter = Mines;
|
||||||
while (minesCoords.Count != coordsCounter)
|
while (minesCoords.Count != coordsCounter)
|
||||||
{
|
{
|
||||||
coord = (Money.GetRandomNumber(Creator, 0, Size), Money.GetRandomNumber(Creator, 0, Size));
|
coord = (Money.GetRandomNumber(Creator, 0, Size, incrementMaxParam: false), Money.GetRandomNumber(Creator, 0, Size, incrementMaxParam: false));
|
||||||
if (!minesCoords.Contains(coord)) minesCoords.Add(coord);
|
if (!minesCoords.Contains(coord)) minesCoords.Add(coord);
|
||||||
else counter++;
|
else counter++;
|
||||||
if (counter >= 100000) throw new Exception($"mines failed to generate mines coordinates. Mines: {Mines} | Board size: {Size} | Current count of mines list {minesCoords.Count}");
|
if (counter >= 100000) throw new Exception($"mines failed to generate mines coordinates. Mines: {Mines} | Board size: {Size} | Current count of mines list {minesCoords.Count}");
|
||||||
|
|||||||
Reference in New Issue
Block a user