What is the easiest way to generate quasi random numbers in C#? -


I want all the random numbers in a practical C # Generator I can say eg

  int dummyj = Mathhalper. Getendamember (20,70);  

And it looks like semi random , e.g. To generate dummy data

Most of us come to philosophical discussions on true randomness on the web, which is not what I am interested in at the moment, e.g. I've used one of PHP for a long time, which uses milliseconds / sleep which is okay for dummy data, I just try to do this I'm C # prompt .

Does anyone have a quick semi civilized C # random number generator on the basis of bead etc. for some time or, how do I change the following code so that it always corresponds to one line Do not generate 5 numbers?

  using the system; Namespace TestRandom23874 {Class Program {Static Wide Men (String [] ARGs) {console. Weedline ("random numbers: {0}", Mathlets: Gatoramandmember (1, 10)); Console.light line ("random number is: {0}", Mathhaller. Getrandom number (1, 10)); Console.light line ("random number is: {0}", Mathhaller. Getrandom number (1, 10)); Console.light line ("random number is: {0}", Mathhaller. Getrandom number (1, 10)); Console.light line ("random number is: {0}", Mathhaller. Getrandom number (1, 10)); Console.ReadLine (); }} Public Class MathHelpers {public static integral number (int min, int max) {random random = new random (); Random return Next (minimum, maximum); }}}}  

public class MathHelpers {private static random random = new Random (); Public Static GetRandomNumber (int minutes, maximum max) {random return. Next (minimum, maximum); }}

In this way, you are not creating a new random object every time, but instead you are using the same again. When you quickly recreate a new one, they will give similar results. If you reuse an existing one, you will get randomness.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -