I am trying to figure out how to create a random float with custom odds. The game i am trying to replicate is Crash. So the minimum number would be 1, and the max could be for example 1000. I have the formula from this site https://bitcointalk.org/index.php?topic=5265896.0
CRASH MULTIPLIER = [(E*100 - H)/(E-H)]/100
Also there is some .js code here from getting the number https://roobet.com/fair but it has hashes and stuff (i dont have them, and i dont need them for this project)
And found this thread too: Math behind generating random number (Crash game BTC Casino)
Anyone know how to do this in C#? Also should i be using System.Random in this? is it actually "random"?
I know how to set the odds, it would go something like this:
Random random = new Random();
double Number = random.NextDouble() * (100 - 1) + 1;
if (Number == 50) //would give me 1% odds
{
CrashRandomNumber = 1; // = means that the Crash game would crash instantly upon starting
}