2013-06-01 18:10:13 +02:00
|
|
|
#include <time.h>
|
|
|
|
|
#include <stdlib.h>
|
2013-06-01 18:18:48 +02:00
|
|
|
#include <stdbool.h>
|
2013-06-01 22:36:15 +02:00
|
|
|
#include <stdio.h>
|
2013-06-01 18:10:13 +02:00
|
|
|
|
|
|
|
|
bool random_if(int p) {
|
2013-06-01 22:36:15 +02:00
|
|
|
//srand(time(NULL));
|
2013-06-01 18:10:13 +02:00
|
|
|
int r = rand() % 100;
|
2013-06-01 22:36:15 +02:00
|
|
|
//printf("Value of r:%d\n",r);
|
2013-06-01 18:10:13 +02:00
|
|
|
return (r < p);
|
|
|
|
|
}
|