How would I loop 1's and 0's into "0001010100111010010"
or something similar to make it look like it does in the matrix, is it possible?
And if so how would you stop the loop?
This is a discussion on Loop this... within the C++ Programming forums, part of the General Programming Boards category; How would I loop 1's and 0's into "0001010100111010010" or something similar to make it look like it does in ...
How would I loop 1's and 0's into "0001010100111010010"
or something similar to make it look like it does in the matrix, is it possible?
And if so how would you stop the loop?
Try thisCode:#include <iostream.h> #include <stdio.h> #include <stdlib.h> #include <time.h> int main() { srand(time(NULL)); for(int i = 0; i < 100000000; i++) { cout << 1 - rand()%-2; i++; } cout << "\n"; return 0; }
Please direct all complaints regarding this post to the nearest brick wallHave a nice day.
Or this:
You can only stop the loop if you're THE ONECode:#include <iostream.h> #include <stdlib.h> #include <time.h> int main(void) { char s[] = "01 "; srand((unsigned int)time(NULL)); while(1) cout << s[rand()%3]; return 0; }
I think I like mine better
Please direct all complaints regarding this post to the nearest brick wallHave a nice day.
Well...mine looks more like the matrix (seen it 2 days ago).