Odd request but sure, I'll oblige.
Code:
#include <iostream>
#include <random>
#include <chrono>
int main() {
double sum = 0;
double its = 0;
while(true) {
std::default_random_engine generator(std::chrono::system_clock::now().time_since_epoch().count());
std::uniform_int_distribution<int> dist(0, 1);
sum += dist(generator);
double avg = sum/++its;
std::cout << avg << "\n";
}
}
save that as "random.cpp" and just compile that with g++
Code:
g++ random.cpp -o random
Then add the following to your shell script:
Bookmarks