-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.c
33 lines (29 loc) · 779 Bytes
/
test.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <unif01.h>
#include <bbattery.h>
#include <emscripten.h>
static double
GetMathRandom()
{
double d = EM_ASM_DOUBLE({
return Math.random();
}, 0);
return d;
}
void EMSCRIPTEN_KEEPALIVE RunSmallCrushMathRandom()
{
unif01_Gen* gen = unif01_CreateExternGen01("Math.random()", GetMathRandom);
bbattery_SmallCrush(gen);
unif01_DeleteExternGen01(gen);
}
void EMSCRIPTEN_KEEPALIVE RunCrushMathRandom()
{
unif01_Gen* gen = unif01_CreateExternGen01("Math.random()", GetMathRandom);
bbattery_Crush(gen);
unif01_DeleteExternGen01(gen);
}
void EMSCRIPTEN_KEEPALIVE RunBigCrushMathRandom()
{
unif01_Gen* gen = unif01_CreateExternGen01("Math.random()", GetMathRandom);
bbattery_BigCrush(gen);
unif01_DeleteExternGen01(gen);
}