time_seed
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <time.h>
|
||||
int put_char(int c) {
|
||||
printf("%c", c);
|
||||
return 0;
|
||||
@@ -13,3 +13,8 @@ bool random_if(int p) {
|
||||
int r = rand() % 100;
|
||||
return (r < p);
|
||||
}
|
||||
|
||||
int time_seed() {
|
||||
srand(time(NULL));
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user