daily update on 20240514 by nitload youmu
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
using Randomizer;
|
||||
|
||||
namespace RandomTest
|
||||
{
|
||||
[TestClass]
|
||||
public class UnitTest1
|
||||
{
|
||||
[TestMethod]
|
||||
public void TestMethod1()
|
||||
{
|
||||
try
|
||||
{
|
||||
string test =
|
||||
"fhasdfkawfgkFlgAVFBADSFGAsd'sddfkd,f[adfl,'a/f';.f'.af;dfasdFNADSLFIKB,ajfhaewgekhbfadslgfvwhgfhlaugbf,hA,FHA";
|
||||
|
||||
RandomGenerator r = new RandomGenerator(test);
|
||||
Random rd = new Random();
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
Console.WriteLine($"{r.GenRandomSingle()}\t\t");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void AverageTest()
|
||||
{
|
||||
string testStr = "dsfhafawe/f'F/C;AFJADSF/'OKEFKlffd/,./a/f''PDP[[pfga" +
|
||||
"ds.3456a4ba5gu;31iyo/i653;o4yolulul64o5;y3yk";
|
||||
|
||||
RandomGenerator r = new RandomGenerator(testStr);
|
||||
|
||||
float[] array = new float[100];
|
||||
float sum = 0.0f;
|
||||
for (int i = 0 ; i<array.Length ; i++)
|
||||
{
|
||||
array[i] = r.GenRandomInt();
|
||||
sum += array[i];
|
||||
}
|
||||
|
||||
Console.WriteLine(sum / array.Length);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user