|
What is the most bizar syntax you have ever written?
Recently I implemented a simple file parser for my script files. The code got tricky when I used pointers to __thiscall member functions, and then made the function call via those pointers.
So what is the most bizar code or the tricky syntax you have ever written?
Hmmm... your code is pretty tricky !!!
Here's somehting that caused MUCH headache:
Tim
--------------------------
glvelocity.gamedev.net
www.gamedev.net/hosted/glvelocity
Edited by - tcs on December 5, 2000 4:57:16 PM
Here's somehting that caused MUCH headache:
|
Tim
--------------------------
glvelocity.gamedev.net
www.gamedev.net/hosted/glvelocity
Edited by - tcs on December 5, 2000 4:57:16 PM
Tim--------------------------glvelocity.gamedev.netwww.gamedev.net/hosted/glvelocity
|
Perl is cool

I didn''t write that btw

I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
July 24, 2001 09:35 AM
This are the kewlest things i''ve ever seen ( not mine )
#include
main(t,_,a)
char *a;
{return!0main(-86, 0, a+1 )+a)):1,t<_?main(t+1, _, a ):3,main ( -94, -27+t, a
)&&t == 2 ?_<13 ?main ( 2, _+1, "%s %d %d\n" ):9:16:t<0?t<-72?main(_,
t,"@n''+,#''/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l,+,/n{n+\
,/+#n+,/#;#q#n+,/+k#;*+,/''r :''d*''3,}{w+K w''K:''+}e#'';dq#''l q#''+d''K#!/\
+k#;q#''r}eKK#}w''r}eKK{nl]''/#;#q#n''){)#}w''){){nl]''/+#n'';d}rw'' i;# ){n\
l]!/n{n#''; r{#w''r nc{nl]''/#{l,+''K {rw'' iK{;[{nl]''/w#q#\
n''wk nw'' iwk{KK{nl]!/w{%''l##w#'' i; :{nl]''/*{q#''ld;r''}{nlwb!/*de}''c \
;;{nl''-{}rw]''/+,}##''*}#nc,'',#nw]''/+kd''+e}+;\
#''rdq#w! nr''/ '') }+}{rl#''{n'' '')# }''+}##(!!/")
:t<-50?_==*a ?putchar(a[31]):main(-65,_,a+1):main((*a == ''/'')+t,_,a\
+1 ):0i@bK''(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),a+1);}
or
#include
#include
#define a typedef
a long N;
#define i =m(p(r,o,v),e,d
N G,l,I,C,B,A,W,L,S
, R,O,c,k,s =
80, U=13
,T=169; a double P;
#define F for(
a P*E; a char*w; P sqrt(P); N H(){ F;
O=scanf(" %[#]%*[^\n]",&O); ); scanf("%ld%*c",&O);
#define D return
D O; }
#define V =malloc(sizeof(
#define M M(
#define X +=
P M N R){ s= s>=k?printf( "%ld%c"
+3*(C<1),s-k, R&7?32:10):s; D R>0?B
/2?H():getchar ():R?.9+.7*M R+1):0; }
P t(N x,P K){ D x?(x>U?0:t(x+2,K)*(x-1)
/x/K)+1/sqrt(K): t(2,K*K/U+1)*K; } N _(N
J,N x){ F*(x?&W:& A)=W+J+x; (O=x=W/(J=k*k))
||AJ*=x+O; S--*B&&x==O ; O=x=!J){ s X x+s; M 0); }
W X W-J; S X 2; L X L-J*k+M S%8==B); } D 1; } E
p(E J,E x,E O){ F R=T; R--; )O[R]=J[R]+.8*x[R]; D O;
} P m(E W,E x,P s){ F R = U; --R; ){ E A=W+R*U; W[R]X s/
12; *W X s; *A-=*x++; F; A>W; ){ *A/=*W; F O=R; O; O--)A[O]-=
W[O]**A; A-=U; } W X 14; } D*W; } int main(int z,w*y){ N K=s,g; Y;
M z); s= B=C=15-H(); s=G= M 8); s=l=M C); G*=g=C%3?1:3; if(I=s=M 8)){ N
b=G+9,x=b*340+U,J=b*(l+5), * n V N ) * J ),*j=n+5*b; E h V P)*x),q=h+b,e=q+
b; P d=K; F; J--; )n[J]=J=4-C; B=C/4; s=_(_(T,0),0); F ; -- z ; ){ R=atoi(*++y); c=R>0?K=R,c :-2*R;
} z=G/K+1; z X g>z; I++; c++; F ; ++ J=o-2*T,v=r-T; F; x [x] );
} p(H,
H,r );
F; x;
) { E S=
e ; w l =
" !{ ,;lf6D@"
; j X 1-g; F; *++l;
){ *S++ =*j; j X*l%3*g-
g+*l%5*b-3*b; } y =M x-G);
y =M-J)* M-x)+ M-J-1)*y+.01; y=
sqrt((u+q[--x]+.1)/y ); o-=T; C i)+
#define Z(x)(t(0,(x-C)/y)-l+1e-6*(x-Q))
.5; K=M-B); { N f=I,Q=0; F; f-Q>c; ){ P l=0
; N H = C+c/2+1; H%=c; H X(f+Q+c-2*H)/2/c*c; l=
Z(Q); O=(A-W)*Z(H)/Z(f); _(O,R=B?K>= H:L/k>O+W); *(
R?&Q:&f)=H; } Q X f; *S=*j=Q/=2; s=B?s:Q+k; f=Q+n[x/z];
n[x/z]=x%z+J%(z*2/g)?f:!putc(x?l[4*g*f/z/z/I-8]:10,stderr);
H-=U; F O=156; O--; ){ H--; *H=e[O%U]*e[O/U]/y+.8**H; } C-=Q+.5
; y i/.9)-Q-C; p(p(r+T,r,r),H,r); h[x]=.7*h[x]+C*C; u X h[x]; u*=.7
; d X C>0?-y:y; } } j X 9; } _(_(x,x),x); } D 0; }
and the there is
#define/**/X
char*d="X0[!4cM,!"
"4cK`*!4cJc(!4cHg&!4c$j"
"8f''!&~]9e)!''|:d+!)rAc-!*m*"
":d/!4c(b4e0!1r2e2!/t0e4!-y-c6!"
"+|,c6!)f$b(h*c6!(d''b(i)d5!(b*a''`&c"
")c5!''b+`&b''c)c4!&b-_$c''d*c3!&a.h''d+"
"d1!%a/g''e+e0!%b-g(d.d/!&c*h''d1d-!(d%g)"
"d4d+!*l,d7d)!,h-d;c''!.b0c>d%!A`Dc$![7)35E"
"!''1cA,,!2kE`*!-s@d(!(k(f//g&!)f.e5''f(!+a+)"
"f%2g*!?f5f,!=f-*e/! "+e6!0f%k)d7!+~^''c7!)z/d-+!''n%a0(d5!%c1a+/d4"
"!2)c9e2!9b;e1!8b>e/! 7cAd-!5fAe+!7fBe(!"
"8hBd&!:iAd$![7S,Q0!1 bF 7!1b?''_6!1c,8b4"
"!2b*a,*d3!2n4f2!${4 f. ''!%y4e5!&f%"
"d-^-d7!4c+b)d9!4c-a ''d :!/i(''`&d"
";!+l''a+d!&d''"
"`0_&c?!$dAc@!$cBc@!$ b < ^&d$`"
":!$d9_&l++^$!%f3a'' n1 _ $ !&"
"f/c(o/_%!(f+c)q*c %! * f &d+"
"f$s&!-n,d)n(!0i- c- k) ! 3d"
"/b0h*!H`7a,![7* i] 5 4 71"
"[=ohr&o*t*q*`*d *v *r ; 02"
"7*~=h./}tcrsth &t : r 9b"
"].,b-725-.t--// #r [ < t8-"
"752793? <.~;b ].t--+r / # 53"
"7-r[/9~X .v90 <6/<.v;-52/={ k goh"
"./}q; u vto hr `.i*$engt$ $ ,b"
";$/ =t ;v; 6 =`it.`;7=` : ,b-"
"725 = / o`. .d ;b]`--[/+ 55/ }o"
"`.d : - ?5 / }o`.'' v/i]q - "
"-[; 5 2 =` it . o;53- . "
"v96 <7 / =o : d =o"
"--/i ]q-- [; h. / = "
"i]q--[ ;v 9h ./ < - "
"52={cj u c&` i t . o ; "
"?4=o:d= o-- / i ]q - "
"-[;54={ cj uc& i]q - -"
"[;76=i]q[;6 =vsr u.i / ={"
"=),BihY_gha ,)\0 " , o [
3217];int i, r,w,f , b ,x ,
p;n(){return r 768?d[X(143+ X r++ + *d ) %
768]:r>2659 ? 59: ( x = d
[(r++-768)% X 947 + 768] ) ?
x^(p?6:0)
p = 34 X X X )
;}s(){for(x= n (); ( x^ ( p
?6:0))==32;x= n () ) ;return x ; }
void/**/main X () { r = p
=0;w=sprintf (X X X X X X o
,"char*d="); for ( f=1;f < * d
+143
if(33-( b=d [ f++ X ] )
){if(b<93){if X(! p ) o
[w++]=34;for X(i = 35 +
(p?0:1);i [w++]=s();o[ w++ ]
=p?s():34;} else X
{for(i=92; i ++)o[w++]= 32;} }
else o [w++ ]
=10;o [
w]=0 ;
puts(o);}
# include
# include
# include
# define W(f) f##Window(S,
# define O ; break ; case
# define _ * s
XID w,r,l=45<<9, d,v =1,E; GC V[2]; typedef
char * K; Display *S; XGCValues g; typedef int Y; K j;
double *o,I [99] ,T= 0,t ,_, atof( ); K X(K
i){ for (r=0 ; o=s-1 ,*i ; i ++ ) { switch (*i){
struct { K Y; Y K, t ; XID k ; } Z; K z= j++;
O 32L :*o *=_ --O ''}'' :*o /=_ --O 73:
*o += _ --O 61 :*o -=_ --O 123
:_= sin (_) O 94 :_= asin (_) O 47
:_= cos (_) O 45 : _= fmod(_ ,2* M_PI
)O 076 :_= sqrt (_) O 33: t=*o; *o=
_; _=t O 48 :_= cos (_) <0 O 86
:j= i O 43: X(z ="K I@I-" )O 93:
X(z ="/ =")O 60 : i =++ r - 4 ? j-1 :i O 79
:XDrawArc(S, d,V [(Y )_] ,(Y ) ( 399 +14 _ [
-2] ),( Y)( *"'' "+14 _ [ -1]) ,2,2 ,0,l
) ; { Z. Y = i - 127 +r/ 3*2 ; Z.K= r%3+
r/3 +1; Z.t =0; Z.k=E ; XDrawText (S,d,*V,(Y
) ( 399 +14 *1[s-= strlen(z) ]),20,
&Z,1); } O 1:default:*i>90?I[*i-32]=_--
*++s
=I[*i+(*i<73)*r]); } } } Y main
(Y G,K*A){ *A=
" 8<$ $li >d# -d8Z''Et#)wWP]WM C\\TI)#%!DcUAvz% H2&08M\\%YaHAW}4+%g ;|XN%W|l!_Kz+$UgBix41r=H7b@_:X 4zS EFo1i}= _D.%biA xF>)k*T(7&m \"G~ )TY *.^@$0.#yl< 66,/dI ;\\[![:- $u6 VnD X+ )TY-L38 :%\" )TY%8Z$ \"G|BfCbm@{;M} ^`K !T PIIIV[;I{ k;I/@{ K!=k;!={LM=M} K!=jM!}T!=k@P=`+e+f+g+hK I-[K I-pEF=Q `FG=Q k@]aK]b;]cP]d@{ EIeK{ FIf;{ GIgP{ HIhVAE{ J{AE/ E0\117<";
w = DefaultScreen ( S =
XOpenDisplay(0)); W( XMap
)d =W(XCreateSimple ) W(
Root )w),0,0,800,80 ,0,0
,BlackPixel(S,w ))) ; g.
foreground=WhitePixel (S,w
); *(Y *) &g=6; for (; v
[V ]=XCreateGC( S,d ,4 +
v, &g),!--v; ); for ( E=
XLoadFont(S,"10x20" ),81
=2; I[84]=( G>2?
atof(2 3028 +3[j])/t)*pow(6e-4+
1,j[ sizeof* X(++j) ]+95
**j- 3072.)-1; )j+=4; s-=
2; W (XClear)d); XFillArc
(S,d ,*V,385,25,0x1c,28,
0,l) ; X( j+4); XSync(S,
0) ; usleep(10000);
All this really works!!!
look at www.ioccc.org
there''s a lot of this stuff ' Target=_Blank>Link
#include
main(t,_,a)
char *a;
{return!0
)&&t == 2 ?_<13 ?main ( 2, _+1, "%s %d %d\n" ):9:16:t<0?t<-72?main(_,
t,"@n''+,#''/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l,+,/n{n+\
,/+#n+,/#;#q#n+,/+k#;*+,/''r :''d*''3,}{w+K w''K:''+}e#'';dq#''l q#''+d''K#!/\
+k#;q#''r}eKK#}w''r}eKK{nl]''/#;#q#n''){)#}w''){){nl]''/+#n'';d}rw'' i;# ){n\
l]!/n{n#''; r{#w''r nc{nl]''/#{l,+''K {rw'' iK{;[{nl]''/w#q#\
n''wk nw'' iwk{KK{nl]!/w{%''l##w#'' i; :{nl]''/*{q#''ld;r''}{nlwb!/*de}''c \
;;{nl''-{}rw]''/+,}##''*}#nc,'',#nw]''/+kd''+e}+;\
#''rdq#w! nr''/ '') }+}{rl#''{n'' '')# }''+}##(!!/")
:t<-50?_==*a ?putchar(a[31]):main(-65,_,a+1):main((*a == ''/'')+t,_,a\
+1 ):0
or
#include
#include
#define a typedef
a long N;
#define i =m(p(r,o,v),e,d
N G,l,I,C,B,A,W,L,S
, R,O,c,k,s =
80, U=13
,T=169; a double P;
#define F for(
a P*E; a char*w; P sqrt(P); N H(){ F;
O=scanf(" %[#]%*[^\n]",&O); ); scanf("%ld%*c",&O);
#define D return
D O; }
#define V =malloc(sizeof(
#define M M(
#define X +=
P M N R){ s= s>=k?printf( "%ld%c"
+3*(C<1),s-k, R&7?32:10):s; D R>0?B
/2?H():getchar ():R?.9+.7*M R+1):0; }
P t(N x,P K){ D x?(x>U?0:t(x+2,K)*(x-1)
/x/K)+1/sqrt(K): t(2,K*K/U+1)*K; } N _(N
J,N x){ F*(x?&W:& A)=W+J+x; (O=x=W/(J=k*k))
||A
W X W-J; S X 2; L X L-J*k+M S%8==B); } D 1; } E
p(E J,E x,E O){ F R=T; R--; )O[R]=J[R]+.8*x[R]; D O;
} P m(E W,E x,P s){ F R = U; --R; ){ E A=W+R*U; W[R]X s/
12; *W X s; *A-=*x++; F; A>W; ){ *A/=*W; F O=R; O; O--)A[O]-=
W[O]**A; A-=U; } W X 14; } D*W; } int main(int z,w*y){ N K=s,g; Y;
M z); s= B=C=15-H(); s=G= M 8); s=l=M C); G*=g=C%3?1:3; if(I=s=M 8)){ N
b=G+9,x=b*340+U,J=b*(l+5), * n V N ) * J ),*j=n+5*b; E h V P)*x),q=h+b,e=q+
b; P d=K; F; J--; )n[J]=J=4-C; B=C/4; s=_(_(T,0),0); F ; -- z ; ){ R=atoi(*++y); c=R>0?K=R,c :-2*R;
} z=G/K+1; z X g>z; I++; c++; F ; ++ J
} p(H,
H,r );
F; x;
) { E S=
e ; w l =
" !{ ,;lf6D@"
; j X 1-g; F; *++l;
){ *S++ =*j; j X*l%3*g-
g+*l%5*b-3*b; } y =M x-G);
y =M-J)* M-x)+ M-J-1)*y+.01; y=
sqrt((u+q[--x]+.1)/y ); o-=T; C i)+
#define Z(x)(t(0,(x-C)/y)-l+1e-6*(x-Q))
.5; K=M-B); { N f=I,Q=0; F; f-Q>c; ){ P l=0
; N H = C+c/2+1; H%=c; H X(f+Q+c-2*H)/2/c*c; l=
Z(Q); O=(A-W)*Z(H)/Z(f); _(O,R=B?K>= H:L/k>O+W); *(
R?&Q:&f)=H; } Q X f; *S=*j=Q/=2; s=B?s:Q+k; f=Q+n[x/z];
n[x/z]=x%z+J%(z*2/g)?f:!putc(x?l[4*g*f/z/z/I-8]:10,stderr);
H-=U; F O=156; O--; ){ H--; *H=e[O%U]*e[O/U]/y+.8**H; } C-=Q+.5
; y i/.9)-Q-C; p(p(r+T,r,r),H,r); h[x]=.7*h[x]+C*C; u X h[x]; u*=.7
; d X C>0?-y:y; } } j X 9; } _(_(x,x),x); } D 0; }
and the there is
#define/**/X
char*d="X0[!4cM,!"
"4cK`*!4cJc(!4cHg&!4c$j"
"8f''!&~]9e)!''|:d+!)rAc-!*m*"
":d/!4c(b4e0!1r2e2!/t0e4!-y-c6!"
"+|,c6!)f$b(h*c6!(d''b(i)d5!(b*a''`&c"
")c5!''b+`&b''c)c4!&b-_$c''d*c3!&a.h''d+"
"d1!%a/g''e+e0!%b-g(d.d/!&c*h''d1d-!(d%g)"
"d4d+!*l,d7d)!,h-d;c''!.b0c>d%!A`Dc$![7)35E"
"!''1cA,,!2kE`*!-s@d(!(k(f//g&!)f.e5''f(!+a+)"
"f%2g*!?f5f,!=f-*e/!
"!2)c9e2!9b;e1!8b>e/! 7cAd-!5fAe+!7fBe(!"
"8hBd&!:iAd$![7S,Q0!1 bF 7!1b?''_6!1c,8b4"
"!2b*a,*d3!2n4f2!${4 f. ''!%y4e5!&f%"
"d-^-d7!4c+b)d9!4c-a ''d :!/i(''`&d"
";!+l''a+d!&d''"
"`0_&c?!$dAc@!$cBc@!$ b < ^&d$`"
":!$d9_&l++^$!%f3a'' n1 _ $ !&"
"f/c(o/_%!(f+c)q*c %! * f &d+"
"f$s&!-n,d)n(!0i- c- k) ! 3d"
"/b0h*!H`7a,![7* i] 5 4 71"
"[=ohr&o*t*q*`*d *v *r ; 02"
"7*~=h./}tcrsth &t : r 9b"
"].,b-725-.t--// #r [ < t8-"
"752793? <.~;b ].t--+r / # 53"
"7-r[/9~X .v90 <6/<.v;-52/={ k goh"
"./}q; u vto hr `.i*$engt$ $ ,b"
";$/ =t ;v; 6 =`it.`;7=` : ,b-"
"725 = / o`. .d ;b]`--[/+ 55/ }o"
"`.d : - ?5 / }o`.'' v/i]q - "
"-[; 5 2 =` it . o;53- . "
"v96 <7 / =o : d =o"
"--/i ]q-- [; h. / = "
"i]q--[ ;v 9h ./ < - "
"52={cj u c&` i t . o ; "
"?4=o:d= o-- / i ]q - "
"-[;54={ cj uc& i]q - -"
"[;76=i]q[;6 =vsr u.i / ={"
"=),BihY_gha ,)\0 " , o [
3217];int i, r,w,f , b ,x ,
p;n(){return r
768]:r>2659 ? 59: ( x = d
[(r++-768)% X 947 + 768] ) ?
x^(p?6:0)

;}s(){for(x= n (); ( x^ ( p
?6:0))==32;x= n () ) ;return x ; }
void/**/main X () { r = p
=0;w=sprintf (X X X X X X o
,"char*d="); for ( f=1;f < * d
+143

){if(b<93){if X(! p ) o
[w++]=34;for X(i = 35 +
(p?0:1);i [w++]=s();o[ w++ ]
=p?s():34;} else X
{for(i=92; i ++)o[w++]= 32;} }
else o [w++ ]
=10;o [
w]=0 ;
puts(o);}
# include
# include
# include
# define W(f) f##Window(S,
# define O ; break ; case
# define _ * s
XID w,r,l=45<<9, d,v =1,E; GC V[2]; typedef
char * K; Display *S; XGCValues g; typedef int Y; K j;
double *o,I [99] ,T= 0,t ,_, atof( ); K X(K
i){ for (r=0 ; o=s-1 ,*i ; i ++ ) { switch (*i){
struct { K Y; Y K, t ; XID k ; } Z; K z= j++;
O 32L :*o *=_ --O ''}'' :*o /=_ --O 73:
*o += _ --O 61 :*o -=_ --O 123
:_= sin (_) O 94 :_= asin (_) O 47
:_= cos (_) O 45 : _= fmod(_ ,2* M_PI
)O 076 :_= sqrt (_) O 33: t=*o; *o=
_; _=t O 48 :_= cos (_) <0 O 86
:j= i O 43: X(z ="K I@I-" )O 93:
X(z ="/ =")O 60 : i =++ r - 4 ? j-1 :i O 79
:XDrawArc(S, d,V [(Y )_] ,(Y ) ( 399 +14 _ [
-2] ),( Y)( *"'' "+14 _ [ -1]) ,2,2 ,0,l
) ; { Z. Y = i - 127 +r/ 3*2 ; Z.K= r%3+
r/3 +1; Z.t =0; Z.k=E ; XDrawText (S,d,*V,(Y
) ( 399 +14 *1[s-= strlen(z) ]),20,
&Z,1); } O 1:default:*i>90?I[*i-32]=_--

=I[*i+(*i<73)*r]); } } } Y main
(Y G,K*A){ *A=
" 8<$ $li >d# -d8Z''Et#)wWP]WM C\\TI)#%!DcUAvz% H2&08M\\%YaHAW}4+%g ;|XN%W|l!_Kz+$UgBix41r=H7b@_:X 4zS EFo1i}= _D.%biA xF>)k*T(7&m \"G~ )TY *.^@$0.#yl< 66,/dI ;\\[![:- $u6 VnD X+ )TY-L38 :%\" )TY%8Z$ \"G|BfCb
w = DefaultScreen ( S =
XOpenDisplay(0)); W( XMap
)d =W(XCreateSimple ) W(
Root )w),0,0,800,80 ,0,0
,BlackPixel(S,w ))) ; g.
foreground=WhitePixel (S,w
); *(Y *) &g=6; for (; v
[V ]=XCreateGC( S,d ,4 +
v, &g),!--v; ); for ( E=
XLoadFont(S,"10x20" ),81
=2; I[84]=( G>2?
atof(2 3028 +3[j])/t)*pow(6e-4+
1,j[ sizeof* X(++j) ]+95
**j- 3072.)-1; )j+=4; s-=
2; W (XClear)d); XFillArc
(S,d ,*V,385,25,0x1c,28,
0,l) ; X( j+4); XSync(S,
0) ; usleep(10000);
All this really works!!!
look at www.ioccc.org
there''s a lot of this stuff ' Target=_Blank>Link
I''ve been in situtations where I have written code to write code, mainly initizing large arrays.
I don''t know if this come under bizar syntax but I think its a bit strange.
I don''t know if this come under bizar syntax but I think its a bit strange.
July 24, 2001 01:59 PM
One time I made a 3D game that did the graphics routine in Visual Basic (with GDI), the menu bar in Assembly, and the Help file in COBOL. JK!
The code I write is not normally meant to be seen by other human eyes, so I favour conciseness over clarity. I know I can understand my own code, so I don''t add extra stuff in. In a library I was writing, I put in a default message handling function. But since the user should be able to extend that handler, I allowed them to set a function variable. The default value, NULL, meant that the user hadn''t set such a function. So how can I, in the least lines possible, check if the user window procedure has been set, if so, calling it, and if not, calling DefWindowProc, and then returning the correct value? I came up with this:
return (UserWndProc?UserWndProc:DefWindowProc)(hWnd, msg, wParam, lParam);
return (UserWndProc?UserWndProc:DefWindowProc)(hWnd, msg, wParam, lParam);
Ok, in my rts, to get the speed of the unit on square (X, Y)
Speed = modReference.ReferenceUnits(Map.Unit(Map.Map(X, Y).UnitIndex).UnitID).Speed
Not actually too screwy to understand, but just gets pretty complex with so many different arrays and stuff... VB doesn''t really lend itself to cool syntaxes like those ones messing with pointers... well, actually, if you put your mind to it, you can come up with some unreadable stuff (like if you decide that you are going to go and use line numbers, "Goto"s and "Let"s.
Oh, and opening files, I like to shove in as many keywords as possible:
Open Filename For Binary Access Read Write Lock Read Write As Filenum
when to do the same thing I could use:
Open Filename For Binary As Filenum
... makes me look smarter
Speed = modReference.ReferenceUnits(Map.Unit(Map.Map(X, Y).UnitIndex).UnitID).Speed
Not actually too screwy to understand, but just gets pretty complex with so many different arrays and stuff... VB doesn''t really lend itself to cool syntaxes like those ones messing with pointers... well, actually, if you put your mind to it, you can come up with some unreadable stuff (like if you decide that you are going to go and use line numbers, "Goto"s and "Let"s.
Oh, and opening files, I like to shove in as many keywords as possible:
Open Filename For Binary Access Read Write Lock Read Write As Filenum
when to do the same thing I could use:
Open Filename For Binary As Filenum
... makes me look smarter

Trying is the first step towards failure.
A nice if condition 
from somewhere in the GCC sources. I didn't write it though.
Edited by - Dactylos on July 25, 2001 7:58:30 AM

|
from somewhere in the GCC sources. I didn't write it though.
Edited by - Dactylos on July 25, 2001 7:58:30 AM
I posted some code a while ago which extracted the path and application name from the argument list of a win32 app in a rather unorthodox manner...
Edited by - Sandman on July 25, 2001 8:21:40 AM
|
Edited by - Sandman on July 25, 2001 8:21:40 AM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement