| | |
The Matrix: Char Reloaded
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
Here's a funny program that simulates the matrix...waaay off topic...
programmed in c++.. kinda dumb..but still
C++ Syntax (Toggle Plain Text)
#include <iostream> #include <ctime> using namespace std; const int NotUsed=system("color 02"); int main() { clock(); int n; double time; char matrixwords[]=" aijk FGHIJKlmnopqrs ABCDtuvELMNO PQRS bcde fghTUVWXYwxyzZ"; char matrix[]="01001100100101011110"; clock(); for(int o=1; o<=70; o++) { cout << "/"; } cout << "\n\n\t\t\tThe Matrix\n\n"; for(int o=1; o<=70; o++) { cout << "/"; } cout << "\n\n\tEnter Matrix ID: (KB's of Data) ::==:: "; cin >> n; for(double t=-1000; t<=1000000; t++); cout << "\n\n\tLoading Matrix Engine."; for(double t=0; t<=5; t++) { for(double u=-10000; u<=10000000; u++); cout << " . "; } time=clock()/1000.0; cout << "\n\n\t\tYou waited " << time << " seconds for the matrix to generate\n\n\t"; for(int i=1; i<=n; i++) { for(int j=1; j<=60; j++) { if((j%2==0) || (j%5==0) || (j%13==0)) { int ran( rand()%21 ); cout << matrix[ran]; } else if(j%3==0) { int ran( rand()%66 ); cout << matrixwords[ran]; } else if(j%7==0) { int ran( rand()%66 ); cout << matrixwords[ran]; } else { int ran( rand()%66 ); cout << matrixwords[ran]; } } cout << "\n\t"; } time+=clock()/1000.0; cout << "\n\n\tTotal Time Taken for the Matrix to Run: " << time << " s\n\n\t"; cin.get(); return 0; }
programmed in c++.. kinda dumb..but still
"C++ : Where friends have access to your private members."
C++: You accidentally create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical assistance is impossible since you can't tell which are bitwise copies and which are just pointing at others and saying, "That's me, over there."
C++: You accidentally create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical assistance is impossible since you can't tell which are bitwise copies and which are just pointing at others and saying, "That's me, over there."
•
•
•
•
Yes, it's a severe blow for all C++-lovers...
And your question is...
Yeah...there is no point in the code...it just simulates the matrix
Last edited by amrith92; Sep 7th, 2008 at 8:44 am.
"C++ : Where friends have access to your private members."
C++: You accidentally create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical assistance is impossible since you can't tell which are bitwise copies and which are just pointing at others and saying, "That's me, over there."
C++: You accidentally create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical assistance is impossible since you can't tell which are bitwise copies and which are just pointing at others and saying, "That's me, over there."
Yeah...I know about that but int main() would need a return statement, which would make my signature 6 lines, one more than is allowed... and anyway, its only just a signature!
Last edited by amrith92; Sep 7th, 2008 at 2:05 pm.
"C++ : Where friends have access to your private members."
C++: You accidentally create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical assistance is impossible since you can't tell which are bitwise copies and which are just pointing at others and saying, "That's me, over there."
C++: You accidentally create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical assistance is impossible since you can't tell which are bitwise copies and which are just pointing at others and saying, "That's me, over there."
Reminds me of the grandaddy of all screensavers. Something like
(This, of course, is just the simplest possible version...)
C Syntax (Toggle Plain Text)
#include <stdlib.h> #include <stdio.h> #include <time.h> int main() { srand( time( NULL ) ); while (1) printf( "%*c", rand() % 15, '*' ); return 0; }
You gotta admit, the Classics are good!
"C++ : Where friends have access to your private members."
C++: You accidentally create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical assistance is impossible since you can't tell which are bitwise copies and which are just pointing at others and saying, "That's me, over there."
C++: You accidentally create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical assistance is impossible since you can't tell which are bitwise copies and which are just pointing at others and saying, "That's me, over there."
![]() |
Other Threads in the C++ Forum
- Previous Thread: Connecting a MIDI-device and getting input signal from it?
- Next Thread: Resource File Error
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer dll download dynamiccharacterarray email encryption error file forms fstream function functions game generator getline givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






