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-02 01:51:19 +02:00
|
|
|
#include <time.h>
|
2013-06-02 01:17:57 +02:00
|
|
|
int put_char(int c) {
|
|
|
|
|
printf("%c", c);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
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;
|
|
|
|
|
return (r < p);
|
|
|
|
|
}
|
2013-06-02 01:51:19 +02:00
|
|
|
|
|
|
|
|
int time_seed() {
|
|
|
|
|
srand(time(NULL));
|
|
|
|
|
return 0;
|
|
|
|
|
}
|