daily update on 20240514 by nitload youmu

This commit is contained in:
YoumuLiu
2024-05-14 15:41:22 +08:00
parent a3506c96a3
commit 2e57126ab7
75 changed files with 3572 additions and 198 deletions
+52
View File
@@ -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);
}
}
}