:

season's greetings

Eleven years ago, one of the Maplesoft developers sent around the office this Maple language port of the first example of obfuscated code here.

This code below is text, for insertion in 1D Maple Notation, and runs in Worksheet mode.

A couple of deliberate mistakes had been made to the code, and the challenge was to find and correct them. In that same spirit, I'm pasting the code with the original errors. Enjoy!

I've added a few line breaks in the source, just to try and accommodate cut 'n paste from this site.

main:=proc()local f:f:=proc(t,_,a)global``:local`--`,`&^`,i:
`if`(not type(``, table),[assign(``,table(zip((`&^`,`--`)->`&^`=`--`,
[seq(i,i=" !\"#\$%&'()*+,-\ ./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[/^_`abcdefghijklmnopqrstuvwxyz{|}~")],
[seq(i,i=32..126)]))),assign(``["\n"],10)],NULL):
`if`(1<t,[`if`(t<3,f(-79,-13,a[1+f(-87,1-_,a[1+f(-86,0,a[2..-1])..-1])..-1]),1),
`if`(t<_,f(t+1,_,a),3),`if`(f(-94,-27+t,a)<>0and t=2,`if`(_<13,f(2,_+1,"%s %d %d\n"),9),16)],
`if`(t<0,`if`(t<-72,f(_,t,"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l+,/n{n+,/+#n+,/#;#q#n+,/+k#;*+,/'r :'d*'3,}{w+( w'(:'+}e#';dq#'l q#'+d'\ (#!/+k#;q#'r}e((#}w'r}e(({nl]'/#;#q#n'X{X#}w'X{X{nl]'/+#n';d}rw' i;# X{nl]!/n\ {n#'; r{#w'r nc{nl]'/#{l,+'( {rw' i({;[{nl]'/w#q#n'wk nw' iwk{(({nl]!/w{%'l##\ w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c ;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;#'rdq#w! nr'/ 'X }+}{rl#'{n' 'X# +}'+}##)!!/"),
`if`(t<-50,`if`(_=``[a[1]],op([printf("%s",a[32]),``[a[32]]]),f(-65,_,a[2..-1])),
`if`(a[1]="/",f(1+t,_,a[2..-1]),f(t,_,a[2..-1])))),`if`(0<t,f(2,2,"%s"),
`if`(a[1]="/"or f(0,f(-61,``[a [1]],"!ek;dc i@b(')qX-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),a[2..-1])<>0,1,0))))end:
kernelopts(printbytes=false):f(1,5666,569112):NULL:end:

main();

Eleven years ago, the above code ran under Unix/Linux, but failed on MS-Windows due to a stack-limit problem. It works for me now in both 32bit and 64bit Windows XP versions of Maple 13.

I'm pretty sure that someone will post the challenge answer very soon, with corrections. If not, then I'll post it.

This has been branched into the following page(s):
﻿