#203713 - 2011-11-14 11:22 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round
[Re: Lonkero]
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
Top
|
|
|
|
#203719 - 2011-11-15 01:24 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round
[Re: Lonkero]
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
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.
|
Top
|
|
|
|
#203720 - 2011-11-15 01:25 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round
[Re: Lonkero]
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
You are usingan older version of KiXtart. Trying using 4.62.
|
Top
|
|
|
|
#203721 - 2011-11-15 01:45 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round
[Re: Howard Bullock]
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
I must have introduced a non-printable character into the code somehow. I re-copied the code form his post and re-edited it. 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
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. 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 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!
|
Top
|
|
|
|
#203725 - 2011-11-15 08:29 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round
[Re: Lonkero]
|
ShaneEP
MM club member
Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
|
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.
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
|
Top
|
|
|
|
#203728 - 2011-11-15 08:47 PM
Re: Kixgolf - Whitespace Obfuscation - Public Round
[Re: Lonkero]
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
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
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
_________________________
!download KiXnet
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
2023-09-28 [Arend_]
Wow even the shouts are old ;-)
2023-11-17 [Dr_Rick]
I love Kixforms!
2023-11-21 [Dave_Melczer]
Getting DB errors again opening posts...anyone else?
2023-11-24 [Flavien]
DB errors confirmed. This forum is showing its age... UBB 7.2.2 is from 2007
2023-11-27 [Sealeopard]
And there goes the forum :-(
2023-11-30 [NTDOC]
Yes, so old no good easy update path
2023-12-01 [mole]
Posts back. No DB errors. Thanks!
2023-12-29 [BradV]
Happy new year!
2024-02-09 [RSLHA]
No access possible!
2024-02-09 [RSLHA]
Database Error!
2024-02-18 [Dr_Rick]
What happened to Bruno
2024-03-08 [mole]
Thanks for getting the posts back again.
2024-04-18 [MarineV]
will the db errors get fixed????
2024-04-26 [Tonny]
database error, please!
2024-05-09 [NTDOC]
I'm not seeing any errors
2024-05-31 [chojin]
DB is down again
2024-06-04 [selsner]
Still no access, please help!
2024-06-07 [mole]
Looks like DB is back again. Thanks.
2024-06-17 [It_took_my_meds]
We encountered a problem. The reason reported was Database error only visible to forum administrators Please click back to return to the previous page.
2024-07-04 [Armin73]
There is still a database error 🤷♂️
2024-07-09 [0neZero]
There is still a database error 🤷♂️
2024-07-10 [Allen]
DB working a few times in between the messages above. Working again as of 7/10. Thanks Doc
2024-08-31 [NetGnostic]
Bummer, the Database error is back.
2024-09-04 [NTDOC]
Fourms are back up without error for the moment
2024-10-02 [Arend_]
Wll still have database errors ;-)
2024-10-03 [Allen]
Thanks to Doc... it's back.
2024-12-09 [chojin]
could we move kixtart to a new place in order to keep it living ? maybe create a github page and a subreddit?
2024-12-10 [Allen]
do know about moving it, but I know Doc is aware of the DB issue. Should be back online soon.
2024-12-10 [Allen]
don't know...
|
|
0 registered
and 435 anonymous users online.
|
|
|