diff options
author | nathansmith117 <nathansmith117@sdf.org> | 2024-05-22 04:51:55 +0000 |
---|---|---|
committer | nathansmith117 <nathansmith117@sdf.org> | 2024-05-22 04:51:55 +0000 |
commit | bdd8d563ff3f0eec41cc45d07f6c00622a531a72 (patch) | |
tree | ceb9cac325b893b20b5d0303e988252136680e03 /evil_puppy/run_evil_puppy.cpp | |
download | forgorttonProjects-bdd8d563ff3f0eec41cc45d07f6c00622a531a72.tar.gz forgorttonProjects-bdd8d563ff3f0eec41cc45d07f6c00622a531a72.tar.bz2 forgorttonProjects-bdd8d563ff3f0eec41cc45d07f6c00622a531a72.zip |
Diffstat (limited to 'evil_puppy/run_evil_puppy.cpp')
-rw-r--r-- | evil_puppy/run_evil_puppy.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/evil_puppy/run_evil_puppy.cpp b/evil_puppy/run_evil_puppy.cpp new file mode 100644 index 0000000..1ab28ae --- /dev/null +++ b/evil_puppy/run_evil_puppy.cpp @@ -0,0 +1,34 @@ +#include <stdio.h> +#include <stdlib.h> +#include <time.h> +#include <random> + +#ifdef _WIN32 + #include <Windows.h> +#else + #include <unistd.h> +#endif + +#define least_time 60 +#define max_time 600 + +using namespace std; + +int random_range(int x, int y) { + random_device rd; + mt19937 gen(rd()); + uniform_int_distribution<> distr(x, y); + + return distr(gen); +} + +int main() { + + while (true) { + time_t when_it_happens = random_range(least_time, max_time); + sleep(when_it_happens); + system("/usr/local/bin/fluffy_puppy"); + } + + return 0; +} |