AllenAdministrator
(KiX Supporter)
2011-11-13 06:00 PM
Kixgolf - Whitespace Obfuscation - Public Round

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


JochenAdministrator
(KiX Supporter)
2011-11-13 06:04 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

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


AllenAdministrator
(KiX Supporter)
2011-11-13 06:09 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

Wow Jochen... my eyes just crossed. Nothing like what I was expecting too see. Care to elaborate on how this works?

JochenAdministrator
(KiX Supporter)
2011-11-13 06:13 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

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


AllenAdministrator
(KiX Supporter)
2011-11-13 06:17 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

The way you are using $k has me completely vexed. Wicked code indeed.

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


Howard Bullock
(KiX Supporter)
2011-11-13 06:53 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

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
 


Howard Bullock
(KiX Supporter)
2011-11-13 06:58 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

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


LonkeroAdministrator
(KiX Master Guru)
2011-11-13 10:56 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

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


AllenAdministrator
(KiX Supporter)
2011-11-13 11:26 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

LOL... WTH! Nice Lonk. You surely have no souls left to sell to the man down stairs now.

LonkeroAdministrator
(KiX Master Guru)
2011-11-13 11:48 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

ran out of extras and my own is not for sale ;\)

JochenAdministrator
(KiX Supporter)
2011-11-14 09:27 AM
Re: Kixgolf - Whitespace Obfuscation - Public Round

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


LonkeroAdministrator
(KiX Master Guru)
2011-11-14 10:21 AM
Re: Kixgolf - Whitespace Obfuscation - Public Round

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


JochenAdministrator
(KiX Supporter)
2011-11-14 11:26 AM
Re: Kixgolf - Whitespace Obfuscation - Public Round

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.


LonkeroAdministrator
(KiX Master Guru)
2011-11-14 11:45 AM
Re: Kixgolf - Whitespace Obfuscation - Public Round

oh...
but... I did not have any asc() while decoding \:\)
just yes/no, as in 1's and 0's


LonkeroAdministrator
(KiX Master Guru)
2011-11-14 11:50 AM
Re: Kixgolf - Whitespace Obfuscation - Public Round

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



LonkeroAdministrator
(KiX Master Guru)
2011-11-14 11:52 AM
Re: Kixgolf - Whitespace Obfuscation - Public Round

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?


LonkeroAdministrator
(KiX Master Guru)
2011-11-14 12:00 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

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!!!


LonkeroAdministrator
(KiX Master Guru)
2011-11-14 12:02 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

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


JochenAdministrator
(KiX Supporter)
2011-11-14 12:14 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

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


LonkeroAdministrator
(KiX Master Guru)
2011-11-14 12:37 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

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=" "


JochenAdministrator
(KiX Supporter)
2011-11-14 01:31 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

Touché!
That indeed blast my code to smithereens ..

But, Riposte, yours too :p (does no good to Howards either)

 Code:
# Tests Failed   = 1
Result           = Failed
KiXGolf Score    = 173


LonkeroAdministrator
(KiX Master Guru)
2011-11-14 01:35 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

now as I got that layout issue sorted :P

Jochen, I quickly tried to remove the thing you do with $k and couldn't so kinda forcing you to now ;\)

your line:
 Code:
 $c=$c+iif($e,$n*(($k^$<' ')&$>),$m[$k^$x/$n])

would translate to:
 Code:
;$k=$k+$<' ' <- this line at the top removed
 $c=$c+iif($e,$n*($<>asc(right($,1))),$m[$k=' ' ^ $x>$n])


but there is something I am missing with the $m-part of the code.
you probably having more insight could actually figure it out.
anyways, this would lead to eliminating the $e and making your code work with my test40 (41st test)


LonkeroAdministrator
(KiX Master Guru)
2011-11-14 01:40 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

mine too?

run on mine:
 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 14:37:49.794
Processing End   = 2011/11/14 14:37:50.858
Duration         = 0000/00/00 00:00:01.063
# Tests Run      = 41
# Tests Passed   = 41
# Tests Failed   = 0
Result           = Passed
KiXGolf Score    = 173


and run on howard's FIXED (tabulator) code:
 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 14:39:39.833
Processing End   = 2011/11/14 14:39:40.190
Duration         = 0000/00/00 00:00:00.357
# Tests Run      = 41
# Tests Passed   = 41
# Tests Failed   = 0
Result           = Passed
KiXGolf Score    = 255


JochenAdministrator
(KiX Supporter)
2011-11-14 01:43 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

yeah, yours too .. at least with what you have posted here \:D

LonkeroAdministrator
(KiX Master Guru)
2011-11-14 01:52 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

I actually tried with that.
and results are the same.


JochenAdministrator
(KiX Supporter)
2011-11-14 02:04 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

 Code:
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
 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


AllenAdministrator
(KiX Supporter)
2011-11-14 02:11 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

I meant to have a line in the rules that explicitly said, "There will be no clear text input that starts or ends with a space or tab."

Sorry, about that, it slipped my mind.


JochenAdministrator
(KiX Supporter)
2011-11-14 02:55 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

I would not disagree ;\)

LonkeroAdministrator
(KiX Master Guru)
2011-11-14 02:59 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

well, it wasn't in the rules, so allen go ahead and let us know will it be added.
it would force ppl to do something during the public round too, so I am for including a whitespace test.

I demand one!!!!! \:\)


AllenAdministrator
(KiX Supporter)
2011-11-14 03:27 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

I need to check something, but I am a bit tied up for the moment. I'll post back asap.

JochenAdministrator
(KiX Supporter)
2011-11-14 03:28 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

Sidenote to Howards code posts:

I noticed that both posts have been edited .. maybe the intrinsic board editor has f*ed with the tabs?


LonkeroAdministrator
(KiX Master Guru)
2011-11-14 04:18 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

I couldn't get the effect no matter how much I kept editing...

LonkeroAdministrator
(KiX Master Guru)
2011-11-14 05:02 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

Jochen, I tried even once more.
copied my code from your post and the test from my post.
renamed it to test41 and got back passed 42, failed 0

I bet your editor replaced tabs again \:D


JochenAdministrator
(KiX Supporter)
2011-11-14 05:19 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

Nope it doesn't .. not when I paste things, only when I type ;\)
Even if I let it show non-printable characters, there are tabs and spaces evenly distributed .. dunno what is going on with this.


LonkeroAdministrator
(KiX Master Guru)
2011-11-14 06:17 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

"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:
 Code:
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


LonkeroAdministrator
(KiX Master Guru)
2011-11-14 06:22 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

$z no longer needed, 234

 Code:
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


LonkeroAdministrator
(KiX Master Guru)
2011-11-14 06:52 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

so... how about that post Allen? \:\)

AllenAdministrator
(KiX Supporter)
2011-11-14 07:07 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

While I'm working... am I correct this only effects Jochen (so far)?

Normally I don't mind adding cases, but I'm really struggling to find any value in it this time. Comments?


JochenAdministrator
(KiX Supporter)
2011-11-14 09:33 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

None

edit: answered your PM though


AllenAdministrator
(KiX Supporter)
2011-11-14 09:51 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

Okay guys... here are the new test cases in a new INI. 45 total now.



LonkeroAdministrator
(KiX Master Guru)
2011-11-14 10:19 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

45, oh...

LonkeroAdministrator
(KiX Master Guru)
2011-11-14 10:24 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

all of them? really?
wonder what makes all of the codes fail...


AllenAdministrator
(KiX Supporter)
2011-11-14 10:29 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

Really? Hang on...

LonkeroAdministrator
(KiX Master Guru)
2011-11-14 10:29 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

so...
what is the difference with 44 and 45?
they look just the same to me and the other one fails and other one works.

edit,
the tests are wrong!
and I thought my code would fail \:D


AllenAdministrator
(KiX Supporter)
2011-11-14 10:32 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

44 key = space
45 key = tab

I need to go out for about an hour. When I get back I will verify the tests. Don't change your code yet.

Sorry for the confusion.


LonkeroAdministrator
(KiX Master Guru)
2011-11-14 10:37 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

please do, I did a printout routine in my code and got key asc() of 32 from both.

JochenAdministrator
(KiX Supporter)
2011-11-14 11:22 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

Perfect Chaos \:o
Me likes


AllenAdministrator
(KiX Supporter)
2011-11-14 11:23 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

Updated INI... http://www.kixtart.org/forums/ubbthreads.php?ubb=download&Number=252

The keys with the Tab got screwed. Chaos avoided.



LonkeroAdministrator
(KiX Master Guru)
2011-11-14 11:34 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

I do accept the new ini \:\)
 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/15 00:33:29.010
Processing End   = 2011/11/15 00:33:30.236
Duration         = 0000/00/00 00:00:01.226
# Tests Run      = 46
# Tests Passed   = 46
# Tests Failed   = 0
Result           = Passed
KiXGolf Score    = 173


LonkeroAdministrator
(KiX Master Guru)
2011-11-14 11:51 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

ok, Jochen, should we go about fixing your code now? \:\)

JochenAdministrator
(KiX Supporter)
2011-11-15 08:45 AM
Re: Kixgolf - Whitespace Obfuscation - Public Round

mornin dudes
will download and check soon if time allows. Damn work all day ;\)


Howard Bullock
(KiX Supporter)
2011-11-15 01:24 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

My code did work. I was fussing with it near the end trying to cut more. I must have not reverted it back before posting. Please except my apologies. I will locate the working and post it shortly.

Howard Bullock
(KiX Supporter)
2011-11-15 01:25 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

You are usingan older version of KiXtart. Trying using 4.62.

Howard Bullock
(KiX Supporter)
2011-11-15 01:45 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

I must have introduced a non-printable character into the code somehow. I re-copied the code form his post and re-edited it.
 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 


 Code:
KiXtart Version  = 4.62
KiXGolf Script   = kixgolf_wo.kix
Scoring Engine   = 3.3
OS               = Windows 7 Professional Edition
CPU              = Intel Pentium Celeron
Speed            = 2394 MHz
Memory           = 4096 MB

Tournament       = Whitespace Obfuscation
Processing Start = 2011/11/15 07:32:13.205
Processing End   = 2011/11/15 07:32:13.423
Duration         = 0000/00/00 00:00:00.217
# Tests Run      = 40
# Tests Passed   = 40
# Tests Failed   = 0
Result           = Passed
KiXGolf Score    = 245

Thank you for participating in KiXtart Golf! 


As for my code, it is now repaired. I used my editor to change TABS to spaces for better formatting. That alters the TAB I used in the code as well. Sorry for the error.
 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 

 Code:
KiXtart Version  = 4.62
KiXGolf Script   = kixgolf_wo.kix
Scoring Engine   = 3.3
OS               = Windows 7 Professional Edition
CPU              = Intel Pentium Celeron
Speed            = 2394 MHz
Memory           = 4096 MB

Tournament       = Whitespace Obfuscation
Processing Start = 2011/11/15 07:44:24.959
Processing End   = 2011/11/15 07:44:25.099
Duration         = 0000/00/00 00:00:00.139
# Tests Run      = 40
# Tests Passed   = 40
# Tests Failed   = 0
Result           = Passed
KiXGolf Score    = 255

Thank you for participating in KiXtart Golf! 


LonkeroAdministrator
(KiX Master Guru)
2011-11-15 01:55 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

yea, found that out. golfed your code already as well.
I guess you ended up working on jochen's cause the rest of the guys haven't posted their codes yet \:\)


ShaneEP
(MM club member)
2011-11-15 08:29 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

Well my 500ish code doesn't work anymore with the new cases, and i don't really have the time to work on it. but i can post it anyways. I doubt there is anything in it of value though.

 Code:
function a($, optional $k,$b,$x,$z)
   if asc($)=32 or asc($)=9
      $k = right($,1)
      $ = Replace($,$k,0)
      $x = iif($k='	',' ','	')
      $ = Replace($,$x,1)+$k
      for $x=0 to len($)/8
         $b=$b+' '+substr($,$x*8+1,8)
      next
      for each $x in Split($b)
         $b = 128
         $=0
         for $z=1 to 8
            $ = $+$b*substr($x,$z,1)
            $b = $b/2
         next
         $a = $a+Chr($)
      next
   else
      $b = asc($)
      for $x=1 to len($)-1
         $b=''+$b+' '+asc(right($,-$x))
      next
      for each $x in Split($b)
         $ = 128
         for $z=1 to 8
            if $<=$x
               $a = $a+"1"
               $x = 0+$x-$
            else
               $a = $a+"0"
            endif
            $ = $/2
         next
      next
      $a = Replace($a,0,$k)
      $ = iif($k="	"," ","	")
      $a = Replace($a,1,$)+$k
endfunction


LonkeroAdministrator
(KiX Master Guru)
2011-11-15 08:31 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

to be accepted for a score in private, a posting is needed in public...
so, there is that value. and you may have some trick that we forgot in your sleeve ;\)


AllenAdministrator
(KiX Supporter)
2011-11-15 08:35 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

Seems like adding if $k and swapping the sections in your original if should fix it. Maybe?

LonkeroAdministrator
(KiX Master Guru)
2011-11-15 08:47 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

I see you turned it to an array and then used for each.
substr() would have got you there without the need for that and with ~100 strikes shorter...

anyways, your code fixed and shorther, 489 -> 475
 Code:
function a($, optional $k,$b,$x,$z)
;   if asc($)=32 or asc($)=9
if not $k
      $k = right($,1)
      $ = Replace($,$k,0)
      $x = iif($k='	',' ','	')
      $ = Replace($,$x,1)+$k
      for $x=0 to len($)/8
         $b=$b+' '+substr($,$x*8+1,8)
      next
      for each $x in Split($b)
         $b = 128
         $=0
         for $z=1 to 8
            $ = $+$b*substr($x,$z,1)
            $b = $b/2
         next
         $a = $a+Chr($)
      next
   else
      $b = asc($)
      for $x=1 to len($)-1
         $b=''+$b+' '+asc(right($,-$x))
      next
      for each $x in Split($b)
         $ = 128
         for $z=1 to 8
            if $<=$x
               $a = $a+"1"
               $x = 0+$x-$
            else
               $a = $a+"0"
            endif
            $ = $/2
         next
      next
      $a = Replace($a,0,$k)
      $ = iif($k="	"," ","	")
      $a = Replace($a,1,$)+$k
endfunction


LonkeroAdministrator
(KiX Master Guru)
2011-11-15 08:48 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

ok... we still missing Eric, right?

AllenAdministrator
(KiX Supporter)
2011-11-15 08:50 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

Yup... talk about hit and run.

ShaneEP
(MM club member)
2011-11-15 09:14 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

yea sorry I couldn't put as much effort as I wanted to on this one. It just happened to fall on a week when I had an engineering statics exam, a calculus III exam, and a US history exam to study for lol. On top of that, I'm supposed to be contributing to a group project to build a 20 step Rube Goldberg machine that blows up and pops a balloon. And then of course work.


Howard Bullock
(KiX Supporter)
2011-11-15 09:42 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

Wow, alot happens here fast.

I just don't have the time to keep up. I see that I had a good foundation that you could use. I have to see if it still passes the new tests.

Lonk, I am amazed how you just seem to see this code and quickly remove unnecessary constructs.


LonkeroAdministrator
(KiX Master Guru)
2011-11-15 10:15 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

with your code the reason might be because your code looks very similar to mine week ago \:\)
if one wanted to, they could easily plug peaces of my code into yours and make it shorter with just copy/replace.
after some 230 I got bored enough to totally take down the loop construct and finally ended up the monster I had. but for starting code, yours look way much like mine.
in my original code (376) I even had this:
$a=$a+$x[($b & 128)>0]+$x[($b & 64)>0]+$x[($b & 32)>0]+$x[($b & 16)>0]+$x[($b & 8)>0]+$x[($b & 4)>0]+$x[($b & 2)>0]+$x[($b & 1)>0]

don't remember any more was it because I wanted to make my code long or what \:D

anyways, I am sad that some of you guys didn't/don't have time to really compete in this round. maybe next time then.


AllenAdministrator
(KiX Supporter)
2011-11-16 10:51 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

Well I can say I've had a productive day... but you guys??? Not so much \:\(

Sad.


LonkeroAdministrator
(KiX Master Guru)
2011-11-16 10:59 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

lol. indeed \:\)

JochenAdministrator
(KiX Supporter)
2011-11-20 07:12 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

What a crazy week .. I still recover from it, and tomorrow the madness starts over.

Sorry guys that I haven't had a chance to play with the new testcases \:\/

Looking forward to the next one! Any outlook on the date yet?


LonkeroAdministrator
(KiX Master Guru)
2011-11-21 02:37 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

hmm... wonder who won.

BradV
(Seasoned Scripter)
2011-11-21 03:06 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

Wasn't me \:\)

JochenAdministrator
(KiX Supporter)
2011-11-21 09:38 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

me neither

AllenAdministrator
(KiX Supporter)
2011-12-06 12:42 AM
Re: Kixgolf - Whitespace Obfuscation - Public Round

Private Round Scores
			Particip.
Name	Score	Points	Points	Total
Jooel	173	5	1	6
Jochen	247	4	1	5
Howard	255	3	1	4
ShaneEP	491	2	1	3
Maciep	*	0	1	1		
 
 
Public Round Scores Bonus Name Score Points Points Total Lonkero 173 5 0 5 Howard 255 4 0 4 ShaneEP 491 3 0 3 Jochen ** 0 0 0 Maciep * 0 0 0

Total Points
Jooel 11 Howard 8 ShaneEP 6 Jochen 5 Maciep 1

* Unpublished Code results in no points ** Code failed public round tests


LonkeroAdministrator
(KiX Master Guru)
2011-12-06 01:00 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

wow. I totally forgot. maciep indeed decided not to post \:\(

BradV
(Seasoned Scripter)
2011-12-06 01:42 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

I got so lost during the private round and I saw the scores everyone else was getting. So, I just gave up. \:\)

LonkeroAdministrator
(KiX Master Guru)
2011-12-06 06:06 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

yea...
with the results of the tournament, I wouldn't be holding a new tournament for a while. not enough participants...


ShaneEP
(MM club member)
2011-12-06 09:52 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

Wow I didn't even realize that I somehow got 3rd after all that lol.

JochenAdministrator
(KiX Supporter)
2011-12-08 02:25 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

 Originally Posted By: Lonkero
yea...
with the results of the tournament, I wouldn't be holding a new tournament for a while. not enough participants...


disagreed .. when's next? This time with clear rules


LonkeroAdministrator
(KiX Master Guru)
2011-12-08 06:49 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

clear rules?
would you actually be playing the next time? ;\)


JochenAdministrator
(KiX Supporter)
2011-12-12 12:19 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

Yes, of course I would ..
And I still owe Allen a brief Explanation what my $m does and why it is so vital for my code not to have leading whitespaces


LonkeroAdministrator
(KiX Master Guru)
2011-12-13 09:21 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round

well...
I got it all this time, so guess I am going to be the one who sits the next one on the sidewalk and smiling...