Here's a funny program that simulates the matrix...waaay off topic...

#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

Recommended Answers

All 11 Replies

Yes, it's a severe blow for all C++-lovers...
And your question is...

Compiled id, kindda funny ya, though...
Not really usefull to be honest :P

Yes, it's a severe blow for all C++-lovers...
And your question is...

No question...I just thought it was kinda funny...it was in another forum, but got moved here...

Compiled id, kindda funny ya, though...
Not really usefull to be honest :P

Yeah...there is no point in the code...it just simulates the matrix

commented: stoopid sig -3

Well, in that case a free advice for a C++ coder: look at the C++ language definition. Must be int main() , not improbable void main() in signature ;)...

Member Avatar for iamthwee

Whatever it is, it looks pretty lame and probably could be improved with a clearscreen function that is system dependent.

Well, in that case a free advice for a C++ coder: look at the C++ language definition. Must be int main() , not improbable void main() in signature ;)...

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!

Reminds me of the grandaddy of all screensavers. Something like

#include <stdlib.h>
#include <stdio.h>
#include <time.h>

int main()
  {
  srand( time( NULL ) );
  while (1) printf( "%*c", rand() % 15, '*' );
  return 0;
  }

(This, of course, is just the simplest possible version...)

Thank you, Duodas, for this brilliant code!
It's so pity it's not a part of the C RTL...

You gotta admit, the Classics are good!

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!

Good news for amrith92: The C++ Standard does not require explicit return statement in int main() !

Good news for amrith92: The C++ Standard does not require explicit return statement in int main() !

Hear, Hear! So this means my Signature is valid!! Anyways, it isn't a standard and I would urge myself never to comment on it again!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.