Page 1 of 4 1234>
Topic Options
#203659 - 2011-11-13 06:00 PM Kixgolf - Whitespace Obfuscation - Public Round
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
The public round has now started. Please post your codes.



Download the Updated Ini for the Public Round> http://www.kixtart.org/forums/ubbthreads.php?ubb=download&Number=252


Edited by Allen (2011-11-14 11:22 PM)

Top
#203661 - 2011-11-13 06:04 PM Re: Kixgolf - Whitespace Obfuscation - Public Round [Re: Allen]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Yay! 2nd place! I guess I can be proud of it still.

Look Ma, 4 iif()'s. \:\)
What have you done, silly Boy! *Slap*



for 247:
 Code:
function a($, optional $k)
    dim $e,$m
    $k=$k+$<' '
    $m=' ','	'
    $e=$<!
    while $
        dim $c,$n,$x
        $x=asc($)
        $n=128
        while $n
            $c=$c+iif($e,$n*(($k^$<' ')&$>),$m[$k^$x/$n])
            $x=$x-$n*($x/$n)
            $n=$n/2
            $=iif($e|$n=0,right($,~),$)
        loop
        $a=$a+iif($e,chr($c),$c+iif($,@,$m[$k]))
endfunction
_________________________



Top
#203662 - 2011-11-13 06:09 PM Re: Kixgolf - Whitespace Obfuscation - Public Round [Re: Jochen]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
Wow Jochen... my eyes just crossed. Nothing like what I was expecting too see. Care to elaborate on how this works?
Top
#203663 - 2011-11-13 06:13 PM Re: Kixgolf - Whitespace Obfuscation - Public Round [Re: Allen]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
In all detail? sure thing, but not today, I have to recover from the brain bleed trying to shave from it today

Nice rest of Sunday to all
_________________________



Top
#203664 - 2011-11-13 06:17 PM Re: Kixgolf - Whitespace Obfuscation - Public Round [Re: Jochen]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
The way you are using $k has me completely vexed. Wicked code indeed.

I'm really looking forward to seeing the others now.

Top
#203665 - 2011-11-13 06:53 PM Re: Kixgolf - Whitespace Obfuscation - Public Round [Re: Allen]
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
KiXGolf Score = 255
 Code:
function a($s, optional $k,$,$c,$e,$p,$z)
  $z=1,128,64,32,16,8,4,2,1
  For $c=1 To ($s^)
    $p=substr($s,$c,1)
    if $k
      ;Encode
      For $=1 to 8
        $a=$a+iif(asc($p) & $z[$], iif($k=" "," "," "), $k)
      Next
    else
      ;Decode
      $=$c mod 8
      $e=$z[$]*(right($s,1)<>$p)+$e
      if $=0
        $a=$a+chr($e)
        $e=0
      endif
    endif
  Next
  $a=$a+$k
endfunction
 


Edited by Howard Bullock (2011-11-13 07:02 PM)
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#203666 - 2011-11-13 06:58 PM Re: Kixgolf - Whitespace Obfuscation - Public Round [Re: Jochen]
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Jochen: Your code for 245
 Code:
function a($, optional $k,$e,$m)
    $k=$k+$<' '
    $m=' ','  '
    $e=$<!
    while $
        dim $c,$n,$x
        $x=asc($)
        $n=128
        while $n
            $c=$c+iif($e,$n*(($k^$<' ')&$>),$m[$k^$x/$n])
            $x=$x-$n*($x/$n)
            $n=$n/2
            $=iif($e|$n=0,right($,~),$)
        loop
        $a=$a+iif($e,chr($c),$c+iif($,@,$m[$k]))
endfunction


Edited by Howard Bullock (2011-11-13 07:00 PM)
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#203667 - 2011-11-13 10:56 PM Re: Kixgolf - Whitespace Obfuscation - Public Round [Re: Howard Bullock]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ok, sorry guys, haven't been around to post my code.
here is my 173:
 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
_________________________
!

download KiXnet

Top
#203670 - 2011-11-13 11:26 PM Re: Kixgolf - Whitespace Obfuscation - Public Round [Re: Lonkero]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
LOL... WTH! Nice Lonk. You surely have no souls left to sell to the man down stairs now.
Top
#203671 - 2011-11-13 11:48 PM Re: Kixgolf - Whitespace Obfuscation - Public Round [Re: Allen]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ran out of extras and my own is not for sale ;\)
_________________________
!

download KiXnet

Top
#203672 - 2011-11-14 09:27 AM Re: Kixgolf - Whitespace Obfuscation - Public Round [Re: Howard Bullock]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Howard,

Nice one.
I wonder why I haven't seen that \:\(

Oh sure, Jooel did what I thought was impossible due to mix of integer and string values. So clear that he must have found a way, but couldn't come up with something.. Sure must run out of spare souls \:o


Edited by Jochen (2011-11-14 09:30 AM)
_________________________



Top
#203673 - 2011-11-14 10:21 AM Re: Kixgolf - Whitespace Obfuscation - Public Round [Re: Jochen]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
integer values?
what you are talking about?

what wondered me was how many lines you guys had.
I don't remember having that many even in my very first code. \:\)

oh, and here is my last code at 181 that supported 8bit characters (you know, ä, ü, etc...):
 Code:
function a($t, optional $k,$,$b) 
$=$+128*($=)
$a=$k

if $t
 $a=chr(iif($k,9+23*($k=" " ^ ($ & asc($t))>),$/99*$b))+a(substr($t,2-($>1 & $k)),$k,$/2,$*(right($t,1)<>left($t,1))+$b*($<99))
endfunction
_________________________
!

download KiXnet

Top
#203674 - 2011-11-14 11:26 AM Re: Kixgolf - Whitespace Obfuscation - Public Round [Re: Lonkero]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
you know .. while decoding: asc($) is an integer ;\) in opposite to space or tab while encoding.
I tried to do it recursively too but that didn't shorten the already gridlocked code. Should have follow this approach from the beginning or start compeletely over.
_________________________



Top
#203675 - 2011-11-14 11:45 AM Re: Kixgolf - Whitespace Obfuscation - Public Round [Re: Jochen]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
oh...
but... I did not have any asc() while decoding \:\)
just yes/no, as in 1's and 0's
_________________________
!

download KiXnet

Top
#203676 - 2011-11-14 11:50 AM Re: Kixgolf - Whitespace Obfuscation - Public Round [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
howard, or someone, can you check that you posted your working code?
I got this out of your 255:
 Code:
KiXtart Version  = 4.61
KiXGolf Script   = kixgolf_wo.kix
Scoring Engine   = 3.3
OS               = Windows 7 Professional Edition
CPU              = Intel Pentium III
Speed            = 1396 MHz
Memory           = 4096 MB

Tournament       = Whitespace Obfuscation
Processing Start = 2011/11/14 12:48:56.692
Processing End   = 2011/11/14 12:48:57.157
Duration         = 0000/00/00 00:00:00.464
# Tests Run      = 40
# Tests Passed   = 30
# Tests Failed   = 10
Result           = Failed
KiXGolf Score    = 255

_________________________
!

download KiXnet

Top
#203677 - 2011-11-14 11:52 AM Re: Kixgolf - Whitespace Obfuscation - Public Round [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
wtf... also your edit of jochen's code produces this:
 Code:
KiXtart Version  = 4.61
KiXGolf Script   = kixgolf_wo.kix
Scoring Engine   = 3.3
OS               = Windows 7 Professional Edition
CPU              = Intel Pentium III
Speed            = 1396 MHz
Memory           = 4096 MB

Tournament       = Whitespace Obfuscation
Processing Start = 2011/11/14 12:51:09.323
Processing End   = 2011/11/14 12:51:10.042
Duration         = 0000/00/00 00:00:00.719
# Tests Run      = 40
# Tests Passed   = 20
# Tests Failed   = 20
Result           = Failed
KiXGolf Score    = 246


what is going on? am I going crazy?
_________________________
!

download KiXnet

Top
#203678 - 2011-11-14 12:00 PM Re: Kixgolf - Whitespace Obfuscation - Public Round [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
this is indeed crazy.
took jochen's code. it worked.
removed the first dim, got this:
 Code:
function a($, optional $k, $e, $m)
    $k=$k+$<' '
    $m=' ','	'
    $e=$<!
    while $
        dim $c,$n,$x
        $x=asc($)
        $n=128
        while $n
            $c=$c+iif($e,$n*(($k^$<' ')&$>),$m[$k^$x/$n])
            $x=$x-$n*($x/$n)
            $n=$n/2
            $=iif($e|$n=0,right($,~),$)
        loop
        $a=$a+iif($e,chr($c),$c+iif($,@,$m[$k]))
endfunction


tested, it works.
it's 245.
compared with what howard had, exact same look.
replaced with howards code and again it failed with 246.
I am not seeing the light here!!!
_________________________
!

download KiXnet

Top
#203679 - 2011-11-14 12:02 PM Re: Kixgolf - Whitespace Obfuscation - Public Round [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
found it.
howards code from jochen's does not have tab in it -> fail.
hmm... that means I ended up with that 245 score? \:o
_________________________
!

download KiXnet

Top
#203681 - 2011-11-14 12:14 PM Re: Kixgolf - Whitespace Obfuscation - Public Round [Re: Lonkero]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
lol, as stated in private: Got to teach your editors not to replace tabs with spaces (unless using notepad or something)

edit: checked Howards post, and indeed the tab in $m='[space]','[tab]' is replaced with two space characters. Ohnoes \:o


Edited by Jochen (2011-11-14 12:27 PM)
_________________________



Top
#203682 - 2011-11-14 12:37 PM Re: Kixgolf - Whitespace Obfuscation - Public Round [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
please add test 41 to the scoring.
this is targeted against jochens $e \:\)

[Test40]
Input=" What if I start my sentence with space?"
Output=" "
Key=" "
_________________________
!

download KiXnet

Top
Page 1 of 4 1234>


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 532 anonymous users online.
Newest Members
rrosell, PatrickPinto, Raoul, Timothy, Jojo67
17877 Registered Users

Generated in 0.078 seconds in which 0.026 seconds were spent on a total of 15 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org