C++
-
Guest
-
^misantropia^
- Posts: 4022
- Joined: Sat Mar 12, 2005 6:24 pm
-
^misantropia^
- Posts: 4022
- Joined: Sat Mar 12, 2005 6:24 pm
C, not C++, but still rather amusing...
Code: Select all
#define A B.
#define C if(
#define D >>E&1
#define F return
#define G typedef
#define H printf( I(
#define J(E,K) for(E=K; E--; )
#define L(M) =N(O.M)+3*N(O.M&O.P),
G
int
Q;
G
unsigned
R;
G
struct
{
Q
N,
S,
P,
T,
U,
V;
}
W;
R
_;
R
N(
R
X)
{
R
Y=
2,
Z;
for
(;
Y
;
Y*=
Y)
{
Z=
-1
/-
~Y
;
X=
(X
/Y
&Z
)+
(X
&Z
)*
(Y
*_
-~-
_)
;
}
F
X;
}
W
S(
W
a)
{
W
B;
_=
1;
A
N=
N(
a.
S)
;
A
S=
N(
a.
N)
;
A
P=
N(
a.
P)
;
A
U=
-1
<<
30
;
A
V=
-a
.U
;
F
B;
}
Q
P(
Q
Y,
Q
b,
R
c)
{
Q
E=
Y+
(b
+8
)%
10
-5
+Y
/4
%2
&31
;
F
c
D||
Y/
4-
E/
4-
~-
(b
&2
)?
-1
:E
;
}
Q
T(
W
B,
Q
a,
Q
b)
{
Q
E=
P(
a,
b,
A
N)
;
F~
E?
A
S
D?
~P
(E
,b
,A
S|
A
N)
?128
|b
*32
|a
:-
1:
b*
32
|a
:E
;
}
Q
U(
W
B,
R
c,
Q
Y)
{
Q
E,
b;
J(
E,
32
)C
(A
N&
c)
D)
J(
b,
2<<
(A
P
D)
)C
T(
B,
E,
b)
>=
Y<<
7)
F
1;
F
0;
}
W
V(
W
B,
Q
Z)
{
R
E=
Z&
31
,b
=Z
/32
&3
,Y
=A
T=
P(
E,
b,
0)
,K
=1
<<
Y;
A
N|=
K;
A
P&=
~K
;
A
P|=
(A
P
D)
<<
Y;
_=
A
S
D&&
U(
B,
K,
1)
;
A
P|=
K&-
1<<
28
;
A
N&=
E=
~(
1<<
E)
;
A
P&=
E;
A
S&=
E;
F
Z>>
7?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
2*
2)
;
e=
0;
C
o<
4)
B=
S(
B)
;
C!
U(
B,
-1
,0
))
{
H" } } { ; { ; } ; } } "
))
;
F
0;
}
H" { { ; { ; ; { ; ; { { } } ; ; { } } } ; ; { ; } } } { ; { ; ; { { ; } } "
)+
(o
&1
)*
13
,I
(" } { { } ; } "
)+
U(
B,
-1
,1
))
;
C
o&
4)
{
o&
1?
scanf
("%d"
,&
n)
:(
scanf
("%d%d"
,&
m,
&n
),
--
m)
;
Z=
A
N>>
m&
1?
T(
B,
m,
n)
:-
1;
C
g=
Z>>
7!=
U(
B,
-1
,1
))
{
H"{ ; { { } { } { ; } ; { "
))
;
}
}
else
{
A
U=
-(
A
V=
1<<
30
);
for
(b
=4
;
e<
65536
&&
b<
20
;
b++
){
Z=
(o
&1
?f
(B
,m
,b
,-
2)
:d
(B
,b
))
.T
;
}
o&
1?
H" } { } "
),
Z>>
5&
3^
3)
:H
" } { } } } { } "
),
32
-(
Z&
31
),
Z>>
5&
3^
3)
;
}
}
B=
V(
B,
Z)
;
g=
o;
C
_)
{
o|=
1;
m=
A
T;
}
else
{
o=
o/
2*
2^
4;
}
C
g<
4)
{
B=
S(
B)
;
}
}
}
-
^misantropia^
- Posts: 4022
- Joined: Sat Mar 12, 2005 6:24 pm
Or else this gem...
Code: Select all
#include <stdio.h>
#define PO(o,t)\
(((o>64)&&(o<91))?(((t>96)&&(t<123))?(t-32):(t)):(((t>64)&&(t<91))?(t+32):(t)))
void main() { char *poo= "poot",
*Poo="pootpoot" ,O[9];int o,t,T,p;(t=p =0)||(*O='\0');while
((o= getc( stdin ))!=( EOF))if ((p== 0)&& (((o>64 )&& (
o<91 )) || ((o> 96 ) &&(o< 123) ))) (
t!=8 )&&(O [t]= o)&& (O[++ t] = '\0')
;else {if (t>7) {for (T = 0 ; T <=7; T++ )
printf("%c", PO(*( O+T), *(Poo+ T))); printf
("%c", o);}else if (t>3){for (T =0;T<=
3;T++) printf
("%c", PO(*(O
+T),*( poo+T)
) ) ; printf( "%c" , o ) ; } else printf ( "%s%c" , O , o ) ; ( t = 0 ) || (
* O = '\0' ) ; ( o == 60 ) && ( ++p ) ; ( o == 62 ) && (p!=0) && ( --p ) ; } }
-
4g3nt_Smith
- Posts: 711
- Joined: Sun Feb 15, 2004 8:00 am
Code: Select all
#include <sys/types.h>
#include <unistd.h>
int main (int argc, char *argv[])
{
while(1)
{
fork();
}
return 0;
}
-
stocktroll
- Posts: 1314
- Joined: Mon Mar 21, 2005 2:44 am
-
^misantropia^
- Posts: 4022
- Joined: Sat Mar 12, 2005 6:24 pm
The good, old fork bomb4g3nt_Smith wrote:Compile and run it.Code: Select all
#include <sys/types.h> #include <unistd.h> int main (int argc, char *argv[]) { while(1) { fork(); } return 0; }
-
^misantropia^
- Posts: 4022
- Joined: Sat Mar 12, 2005 6:24 pm
http://www.ioccc.org/U4EA wrote:There's actually a competition where you have to produce a working application (according to predefined specs) but you have to make the code as arcane as possible. Some of the entries were downright scary. Don't remember where I read about it, but I'm sure a google search would turn up something.
Those snippets I posted are entries from the 90s
-
^misantropia^
- Posts: 4022
- Joined: Sat Mar 12, 2005 6:24 pm
Sure, inphlict is going to be developing cross platform applications and he barely knows C++.^misantropia^ wrote:Sure, tie yourself down to a single platform (CLR).bitWISE wrote:You might want to look into C# as well. I kind of like it and the fact you can use it for ASP as well as applications is pretty cool.