#203688 - 2011-11-14 02:04 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round
[Re: Lonkero]
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
Tournament = Whitespace Obfuscation
Processing Start = 2011/11/14 14:01:26.046
Processing End = 2011/11/14 14:01:26.609
Duration = 0000/00/00 00:00:00.562
# Tests Run = 41
# Tests Passed = 40
# Tests Failed = 1
Result = Failed
KiXGolf Score = 173
your code
function a($t, optional $k,$,$b)
$a=$k
if $t
$a=chr(iif($k,9+($k=" " ^ ($ & asc($t))>)*23,($=)*$b))+a(substr($t,2-(~$ & $k)),$k,$/2+64*($=),$*(right($t,1)<>left($t,1))+$/$*$b)
endfunction
copied test 41 40 from your post
Edited by Jochen (2011-11-14 02:09 PM)
_________________________
|
Top
|
|
|
|
#203701 - 2011-11-14 06:17 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round
[Re: Jochen]
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
"fixing" Jochen's code seems too hard for me, so, wen't for Howards instead.
237 by switching $z and $ and then taking out the need for the array stuff:
function a($s, optional $k,$z,$c,$e,$p,$)
; $=1,128,64,32,16,8,4,2,1
For $c=1 To ($s^)
$=$+($=)*128
$p=substr($s,$c,1)
if $k
;Encode
For $z=1 to 8
$a=$a+iif(asc($p) & $, iif($k=" "," "," "), $k)
$=$/2
Next
else
;Decode
; $z=$c mod 8
$e=$*(right($s,1)<>$p)+$e
$=$/2
if $=0
; if $z=0
$a=$a+chr($e)
$e=0
endif
endif
Next
$a=$a+$k
endfunction
_________________________
!download KiXnet
|
Top
|
|
|
|
#203702 - 2011-11-14 06:22 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round
[Re: Lonkero]
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
$z no longer needed, 234
function a($s, optional $k,$c,$e,$p,$)
For $c=1 To ($s^)
$=$+($=)*128
$p=substr($s,$c,1)
if $k
;Encode
; For $z=1 to 8
For $e=1 to 8
$a=$a+iif(asc($p) & $, iif($k=" "," "," "), $k)
$=$/2
Next
else
;Decode
$e=$*(right($s,1)<>$p)+$e
$=$/2
if $=0
$a=$a+chr($e)
$e=0
endif
endif
Next
$a=$a+$k
endfunction
_________________________
!download KiXnet
|
Top
|
|
|
|
#203706 - 2011-11-14 09:51 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round
[Re: Jochen]
|
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4549
Loc: USA
|
Okay guys... here are the new test cases in a new INI. 45 total now.
Attachments
kixgolf_wo.ini (420 downloads) Description:
Edited by Allen (2011-11-14 11:22 PM) Edit Reason: Updated INI
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 649 anonymous users online.
|
|
|