aboutsummaryrefslogtreecommitdiffstats
path: root/evil_puppy/run_evil_puppy.cpp
blob: 1ab28aebffce96a83a579db70889df1a3ae3bde1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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;
}