I've been learning c# and I want to start an experimental console application project of an American Football Simulator. It is vital for this project to have chances.
Example: there's a 20% chance the kicker will succeed in a field goal kick over 45 yards.
I've looked around on here and noticed people using randoms, but is that really the most efficient way to go about doing this?
Random chance = new Random(1, 100);
If (Yards > 45)
{
If (chance <= 20)
{
// Field goal success
}
else
{
// Field goal fail
}
}
What would be the best way to go about doing this?