Skip to content

Instantly share code, notes, and snippets.

@dheaney
Created February 18, 2014 03:32
Show Gist options
  • Select an option

  • Save dheaney/9064221 to your computer and use it in GitHub Desktop.

Select an option

Save dheaney/9064221 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <stdlib.h>
using namespace std;
int main() {
int i;
for(i = 0; i < 50; i++) {
cout << rand() % 2 << endl;
}
return 0;
}
Copy link
Copy Markdown

ghost commented Feb 19, 2014

There's a bug here: you use rand() without ever seeding the random number generator. I have a gist of a fixed version. Hope this help! ๐Ÿ˜‰

@dheaney
Copy link
Copy Markdown
Author

dheaney commented Feb 20, 2014

@mfabel I know. Thanks, though ๐Ÿ˜„

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment