add gaussian fake random value

This commit is contained in:
tTh
2018-12-06 21:06:34 +01:00
parent 8da6c9ffd6
commit 94f95655c1
2 changed files with 20 additions and 6 deletions

18
funcs.c
View File

@@ -12,12 +12,24 @@ extern int verbosity;
/* --------------------------------------------------------------- */
int random1000(int foo)
int random1000(int type)
{
int value;
if (verbosity)
fprintf(stderr, ">>> %s(%d)\n", __func__, foo);
value = rand() % 1000;
fprintf(stderr, ">>> %s(%d)\n", __func__, type);
switch (type) {
case 0:
value = rand() % 1000;
break;
case 1:
value = (rand()%1000 + rand()%1000) / 2;
break;
default:
value = -1;
break;
}
return value;
}