COOL CODE!(50分)

  • 主题发起人 主题发起人 4.13
  • 开始时间 开始时间
4

4.13

Unregistered / Unconfirmed
GUEST, unregistred user!

Newsgroup nugget: Obfuscated Delphi? - by Anders Ohlsson




Abstract:An old favorite. This time in Delphi. Somebody's got too much time on their hands...



Subject: One more time...
Date: Fri, 22 Dec 2000 15:23:51 GMT
From: Colin Wilson
Reply-To: colin@wilsonc.demon.co.uk
Organization: Woozle Software
Newsgroups: borland.public.delphi.non-technical

.. turn off word-wrap ...

program xmas;

{$APPTYPE CONSOLE}

function t_ (t, _ : Integer
a : PChar) : Integer;
begin
if 1<t then begin if t<3 then t_(-79,-13,a+t_(-87,1-_,t_(-86,0,a+1)+a)
)
if t<_ then t_(t+1,_,a)
if (t_(-94,-27+t,a)<>0) and (t=2) then if _<
13 then result:=t_(2,_+1,'%s %d %d'#13) else result:=9 else result:=16 end
else if t<0 then if t<-72 then result:=t_(_,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;# ){nl]!/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'' '')# }''+}##(!!/') else if t<
-50 then if _=Ord(a^) then begin result:=Ord(a[31])
if a[31]=#13 then WriteLn
else Write(a[31])
end else result:=t_(-65,_,a+1) else result:=t_(Ord(a^
='/')+t,_,a+1) else if 0<t then result:=t_(2,2,'%s') else result:=Ord((a^=
'/') or (t_(0,t_(-61,Ord(a^),'!ek;dc i@bK''(q)-[w]*%n+r3#l,{}:'#13'uwloc'+
'a-O;m .vpbks,fxntdCeghiry'),a+1)<>0))
end;

begin
t_ (1, 10000, '')
end.

 
代码正确么??
 
function t_ (t, _ : Integer
a : PChar) : Integer;
begin
if 10) and (t = 2) then
//~~~错了
if _ < 13 then
result := t_(2, _ + 1, '%s %d %d'#13 )
else
result := 9
else
result:=16
end //结束了?
else if t < 0 then
if t < -72 then
result := t_(_, 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;# ){nl]!/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'' '')# }''+}##(!!/')
//一段无聊的冗余代码
else if t < -50 then
if _ = Ord(a^) then begin
result := Ord(a[31])

if a[31] = #13 then
WriteLn
else
Write(a[31])

end else
result := t_(-65, _, a + 1)
else
result:=t_(Ord(a^ = '/') + t, _, a + 1)
else if 00))
//~~~~~~又错了
end;

 
Not very cool, there are so many codes written by C language like these
can be converted to pascal.
 
really cool??????!!!!!!
 
不要轻易说人家代码错嘛!看了if 10) 就知道肯定是小于号被浏览器吃了。
这点经验都没有,上网不是很累嘛 :-)

代码本身也不错呀,我觉得比我看到的很多C代码还眼花缭乱呢,
可这不是把人往邪路上带吗?pascal/delphi可是教人规范的呀 :-)
 
多谢温柔一刀的指教,一时没有想到,呵呵。
 
呵呵,
有趣
 
后退
顶部