Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

rand() warmup

Name: Anonymous 2012-01-20 16:28

void init_random() {
    clock_t start = clock();
    int i = 0;
    while (clock() - start == 0) {
        i++;
    }
    srand(time(0) + i);
}


17±3 ms
Is it okay?

Name: Anonymous 2012-01-21 3:52

>>13
While using real-world data in your randomness is great, if it's entirely from things that the user can very potentially influence, you might have issues with users being able to 'control' your randomness. Albeit that's a bit of a far stretch, depending on what sensory input you use and how you use it.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List