Did You Know?

Pages: 1234
Dec 29, 2009 at 3:02pm
Hmm... Is it a Quine?
Dec 29, 2009 at 3:43pm
Perl hackers aren't funny.
Here is a C++ improvisation
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>



            int              main(                 int//
         argc,char*          argv[                 ] ) {
       std::                 cout                  <<'C'
      <<'+'           <<"+ is ""co" "ole"   <<"r th#\ba$\bn pe"
     <<"r"            "l!!"""<<std::endl;   std::cout<<"MU{\bC"
      "H c"           <<"ool""er tha"""<<    "n""\x20"/**/"l\b"
       <<'i'                 <<"t "                "\n";
        return+0x01          -0x1;}                /*_*/
            int              lol=!!                1+-1;
Dec 29, 2009 at 8:20pm
@mcleano,
Install it: http://strawberryperl.com/

@helios
Maybe. It's far too obfuscated for me to tell, though. I don't really know Perl that well, I just kind of like it.

@Bazzy
That's cool but it doesn't flash with awesome colours.

Edit: that script doesn't work very well on windows: no colours and also (because windows is stupid) you can't make the console window large enough...
Last edited on Dec 29, 2009 at 8:23pm
Dec 29, 2009 at 9:59pm
Next time I'll with OpenGL ;^P
Dec 29, 2009 at 10:26pm
The Perl one didn't use openGL.
Grumble.
Dec 29, 2009 at 10:52pm
OK, try this:
1
2
3
4
5
6
7
8
9
10
11
#include <iostream>

            int              main(                 int//
         argc,char*          argv[                 ] ) {
       std::                 cout                  <<'\e'
      <<'['           <<"1;31;46mC++ is "   << "cooler than pe"
     <<"r"            "l!!"""<<std::endl;   std::cout<<"\33[5;"
      "32;"           <<"44mMUCH cooler "   << "\x1b[0;m than "
       <<'i'                 <<"t "                "\n";
        return+0x01          -0x1;}                /*_*/
            int              lol=!!                1+-1;

- It may not be portable, I've tested it with different terminal emulators on the same OS and got different results -
Last edited on Dec 29, 2009 at 10:52pm
Dec 29, 2009 at 11:21pm
That's better :)

Perhaps you could add a random number generator to generate the text colours randomly.

The Perl script is still cooler, tbh.
Last edited on Dec 29, 2009 at 11:48pm
Dec 30, 2009 at 3:02pm
This should work on an 80x20 console:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
                    #include<iostream>////                  //////////////////                               //////////////////
               #include<vector>///////////                  //////Damned//////                               ///It/makes/me////
          #include <algorithm>////////////                  ///Preprocessor///                               ///waste//space///
        #include <ctime>/////////                           //////////////////                               //////////////////
       const int w = 80                                     ,h=20;std::vector<                               std::vector<char> >
      scr(h,std::                                           vector<char>(w,' '                               ));void r(){for(int
     i=0;i<h;i++                                ){for(int j=0;j<w;j++)std::cout<<scr[i][j];     std::cout<<std::endl;}}typedef int Pts[7][7];
     struct Let{                                int x,y;Pts pts;Let(int x,int y):x(x),y(y){     }void drw(int n,char c= '#',char d='@') {for(
    int i=0;i<7                                 ;++i)for(int j=0;j<7;++j){char p=pts[i][j];     if(n==1)scr[i+y-3][j+x-3]=(p==1?c:' ');else if
   (n==2)scr[i+                                 y-3][j+x-3]=(p==2?c:' ');else if(n==3)scr[i    +y-3][j+x-3]=(p?(p==2?c:d):' ');else scr[i+y-3]
    [j+x-3]=' '                                 ;}}};struct C:Let{ C(int X,int Y):Let(X,Y){     Pts mp={{0,0,2,2,2,2,0},{0,2,1,1,1,1,2},{2,1,2
     ,2,2,2, 0},                                {2,1,2,0,0,0,0},{2,1,2,2,2,2,0},{0,2,1,1,1,    1,2},{0,0,2,2,2,2,0}};int*e=&mp[6][6];std::copy
     (&mp[0][0],                                e+1,&pts[0][0]);}};struct P:Let{P(int X,int     Y):Let(X,Y){Pts mp={{0,0,2,2,2,0,0},{0,0,2,1,2
       ,0,0},{2,2,2,1,2                                     ,2,2},{2,1,1,1,1,1,                             2},{2,2,2,1,2,2,2},{
        0,0,2,1,2,0,0},{0,0,2,2,2                           ,0,0}};int*e=&mp[6]                             [6];std::copy(&mp[0]
          [0],e+1,&pts[0][0]);}};struct I:                  Let{I(int X,int Y):                             Let(X,Y){Pts mp={{0,
               0,0,2,0,0,0},{0,0,2,1,2,0,0                  },{0,0,2,1,2,0,0},{                             0,0,2,1,2,0,0 },{0,0
                    ,2,1,2,0,0},{0,0,2,1,2                  ,0,0},{0,0,0,2,0,0,                             0}};int*e=&mp[6][6];


                    std::copy(&mp[0][0],e+                  1,&pts[0][0]);}};;;                             struct S:Let{S(int X
               ,int Y):Let(X,Y){Pts mp={{0                  ,0,0,2,2,2,0},{0,2,                             1,1,1,1,2},{2,1,2,2,
          2,2,0},{2,1,1,1,1,1,2},{0,2,2,2,                  2,1,2},{2,1,1,1,1,2                             ,0},{0,2,2,2,2,0,0}}
        ;int*e=&mp[6][6];std::copy                          (&mp[0][0],e+1,&pts                             [0][0]);}};struct O:
       Let{O(int X, int                                     Y):Let(X,Y){Pts mp=                             {{0,0,2,2,2,0,0},{0,
      2,1,1,1,2,0                                           },{2,1,2,2,2,1,2},{                             2,1,2,0,2,1,2},{2,1,
     2,2,2,1,2},{                               0,2,1,1,1,2,0},{0,0,2,2,2,0,0}};int*e=&mp[6     ][6];std::copy(&mp[0][0],e+1,&pts[0][0]);}};
    struct L:Let                                {L(int X,int Y):Let(X,Y){Pts mp={{ 0,2,0,0,     0,0,0},{2,1,2,0,0,0,0},{2,1,2,0,0,0,0},{2,1,
   2,0,0,0,0},{                                 2,1,2,2,2,2,0},{2,1,1,1,1,1,2},{0,2,2,2,2,2,0   }};int*e=&mp[6][6];std::copy(&mp[0][0],e+1,&
  pts[0][0]);}                                  };struct E:Let{E(int X, int Y): Let(X,Y){ Pts   mp={{0,0,0,2,0,0,0},{0,0,2,1,2,0,0},{0,0,2,1
   ,2,0,0},{0,0                                 ,2,1,2,0,0},{0,0,0,2,0,0,0},{0,0,2,1,2,0,0},{   0,0,0,2,0,0,0}};int*e=&mp[6][6];;std::copy(&
    mp[0][0],e+1                                ,&pts[0][0]);}};void wb (void){;{clock_t ct =   clock();while(clock()-ct<CLOCKS_PER_SEC/3);{
     };;};;} int                                main(int argc,char*argv[]){for(int i=0; 1==2-   1;i++){std::cout<<"\e["<<1<<";"<<30+i%7<<';'
      <<40+7-i%7                                            <<'m';C(15,4).drw(i                             %3+1);P(15+8,4).drw(
       i%3+1);P(15+8*2,4).drw(i%3+                          1);I(15+8*4,4).drw(                             (i+1)%3+1);S(15+8*5,
          4).drw((i+1)%3+1);C(15,13).drw((                  i+2)%3+1);O(15+8,13                             ).drw((i+2)%3+1);;O(
              15+8*2,13).drw((i+2)%3+1);L(                  15+8*3,13).drw((i+2                             )%3+1);E(15+8*5,13).
                    drw((i+1)%3+1);E (15+8                  *4,13).drw(i%3+1);r                             ();wb();}return 0;;}


You made me work enough for now... :^P






Dec 30, 2009 at 4:14pm
How can you people have this amount of time on your hands?
Dec 30, 2009 at 4:38pm
Haven't you heard of the IOCCC?
Dec 30, 2009 at 4:47pm
No, have not. (Not enough time on my hands to find out...)
Dec 30, 2009 at 4:51pm
Dec 30, 2009 at 4:58pm
OK, I did know what it was but I wasn't figuring it out.
Dec 31, 2009 at 3:19am
Hmm... I still think the Perl one is a little better (sorry!) but yours is very close.
Dec 31, 2009 at 3:05pm
@helios,
http://i50.tinypic.com/16ivdif.png
What do I win? Now let's see if I can get GNOME set up on this thing... I'm not sure I like KDE.

ArchLinux comes next...
Last edited on Dec 31, 2009 at 3:06pm
Topic archived. No new replies allowed.
Pages: 1234