Created
August 18, 2024 08:02
-
-
Save GoombaProgrammer/469cc539327eda355571c2613daef17e to your computer and use it in GitHub Desktop.
c# random number gen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace librand | |
{ | |
public class librand | |
{ | |
public static int rand(int min, int max) | |
{ | |
Random r = new Random(); | |
for (int i = min; i < max; i++) | |
{ | |
if (r.Next(0, 2) == 1) | |
{ | |
return i; | |
} | |
} | |
return max; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment