Description:
new challenges as of 2006!
In this challenge you are asked to take the obfuscated code below and shorten it as much as possible.
The code has been deliberately made longer than necessary. You will need to understand what the code does in order to shorten it substantially. The code MUST return the same output as the code below.
Here is the code:
alias obs {
var %=, %$ 1,%%,%:,%:.,%l $len($1-) | while %$ <= %l { %= = $calc($asc($mid($1-,%$,1))/2.9+%=) | %$ = %$ + 1 } | %= = $left(%=,$pos(%=,.)) | %l = $iif(*0 iswm %l,9,$right(%l,1)) | %$ = 1 | while %$ <= $len(%=) { %: = $mid(%=,%$,%l)
while %: { %:. = $iif($calc(%: % ($asc(%)-21)) > 9,$chr($calc(5*11+$v1)),$v1) $+ %:. | %: = $int($calc(%: /($asc(/:.)-31))) } | %% = %% $+ $iif(%:.,$v1,0) | %$ = %$ + %l } | return %% }
Example:
$obs(z) = 4
$obs(123456) = 6A
$obs(?:@~0-+) = 9A
$obs('';,,.,//??///##=-2990425//:!::::!@#s]/) = 2AD
Hint: V2hpbGUgdGhlcmUgaXMgYSBtaXJjIHBhcnNlciBlcnJvciB5b3VyIGNvZGUgd2lsbCByZW1haW4gdmFsaWQu
Rules:
Alias name must remain 'obs'
No dlls, coms, sockets or regular expressions
One submission per user
Your code will be taken for EXACTLY as submitted. Nothing will be changed in your submitted code - even if a subtle mistake is found.
Alias will be run on mirc v6.16 $decode is allowed.
Script must give correct results after consecutive runs.
File will be loaded into the remotes section
Code will sometimes return nothing ($null) - This is intentional.
File we will be using to count the code: countcode.mrc
Alias will be run on a mirc with no variables set - a clean mirc.
Alias MUST return the same output as the alias above - your code will be tested against input values of different character sets and lengths of up to 900 chars against the original 'obs'.
Entries will be judged on code size and whether they return the same output as the original 'obs' alias.