From 4d89477bce3476b15fb6132d0141aa1655dc5800 Mon Sep 17 00:00:00 2001 From: Deathsbreed Date: Tue, 4 Nov 2014 11:59:32 -0600 Subject: [PATCH] Trying to use progress. --- src/main.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 3205c7b..1145cea 100644 --- a/src/main.c +++ b/src/main.c @@ -72,13 +72,22 @@ int main(int argc, char **argv) { // Setup the random number generator with the seed being the time srand(time(NULL)); + //int oldprogress = 0; + printf("Calculating random numbers...\n"); + //printf("Progress: 0 %%\n"); for(int i = 0; i < trials; i++) { - if(i % 100000000 == 0) printf("Working...\n"); + /*int progress = i * 100 / trials; + if(progress != oldprogress && progress % 10 == 0) { + printf("Progress: %i %%\n", progress); + oldprogress = progress; + }*/ + //if(i % 100000000 == 0) printf("Working...\n"); int r = rand() % 100 + 1; // Calculate random number between 1 and 100 if(r <= 50) heads++; else tails++; } + //printf("Progress: 100 %%\n"); printf("Done.\n"); printf("Heads: %i\n", heads);