Esempio n. 1
0
        public static void Paint(WriteableBitmap bitmap, NoiseVM noise)
        {
            var rng = new XorShift128Plus(noise.RandomSeed.Value);

            WritePixels(bitmap, (x, y) => {
                byte r = (byte)rng.Next(256);
                byte g = (byte)rng.Next(256);
                byte b = (byte)rng.Next(256);
                return(Color.FromRgb(r, g, b));
            });
        }
Esempio n. 2
0
 public void Next(int n)
 {
     for (int i = 0; i < 100; ++i)
     {
         Assert.InRange(rng.Next(n), 0, n - 1);
     }
 }