first stuff of randomif

This commit is contained in:
Florian Sattler
2013-06-01 18:10:13 +02:00
parent 712cc419ab
commit 993c730912
3 changed files with 33 additions and 0 deletions

9
src/libscully.c Normal file
View File

@@ -0,0 +1,9 @@
#include <time.h>
#include <stdlib.h>
bool random_if(int p) {
srand(time(NULL));
int r = rand() % 100;
return (r < p);
}