|
|
|||||||
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 |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
Wow Jochen... my eyes just crossed. Nothing like what I was expecting too see. Care to elaborate on how this works? |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
The way you are using $k has me completely vexed. Wicked code indeed. I'm really looking forward to seeing the others now. |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
LOL... WTH! Nice Lonk. You surely have no souls left to sell to the man down stairs now. |
||||||||
|
|
|||||||
ran out of extras and my own is not for sale |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
oh... but... I did not have any asc() while decoding just yes/no, as in 1's and 0's |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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? |
||||||||
|
|
|||||||
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!!! |
||||||||
|
|
|||||||
found it. howards code from jochen's does not have tab in it -> fail. hmm... that means I ended up with that 245 score? |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
please add test 41 to the scoring. this is targeted against jochens $e [Test40] |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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) |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
yeah, yours too .. at least with what you have posted here |
||||||||
|
|
|||||||
I actually tried with that. and results are the same. |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
I would not disagree |
||||||||
|
|
|||||||
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!!!!! |
||||||||
|
|
|||||||
I need to check something, but I am a bit tied up for the moment. I'll post back asap. |
||||||||
|
|
|||||||
Sidenote to Howards code posts: I noticed that both posts have been edited .. maybe the intrinsic board editor has f*ed with the tabs? |
||||||||
|
|
|||||||
I couldn't get the effect no matter how much I kept editing... |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
"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 |
||||||||
|
|
|||||||
$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 |
||||||||
|
|
|||||||
so... how about that post Allen? |
||||||||
|
|
|||||||
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? |
||||||||
|
|
|||||||
None edit: answered your PM though |
||||||||
|
|
|||||||
Okay guys... here are the new test cases in a new INI. 45 total now. |
||||||||
|
|
|||||||
45, oh... |
||||||||
|
|
|||||||
all of them? really? wonder what makes all of the codes fail... |
||||||||
|
|
|||||||
Really? Hang on... |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
please do, I did a printout routine in my code and got key asc() of 32 from both. |
||||||||
|
|
|||||||
Perfect Chaos Me likes |
||||||||
|
|
|||||||
Updated INI... http://www.kixtart.org/forums/ubbthreads.php?ubb=download&Number=252 The keys with the Tab got screwed. Chaos avoided. |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
ok, Jochen, should we go about fixing your code now? |
||||||||
|
|
|||||||
mornin dudes will download and check soon if time allows. Damn work all day |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
You are usingan older version of KiXtart. Trying using 4.62. |
||||||||
|
|
|||||||
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! |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
Seems like adding if $k and swapping the sections in your original if should fix it. Maybe? |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
ok... we still missing Eric, right? |
||||||||
|
|
|||||||
Yup... talk about hit and run. |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
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 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. |
||||||||
|
|
|||||||
Well I can say I've had a productive day... but you guys??? Not so much Sad. |
||||||||
|
|
|||||||
lol. indeed |
||||||||
|
|
|||||||
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? |
||||||||
|
|
|||||||
hmm... wonder who won. |
||||||||
|
|
|||||||
Wasn't me |
||||||||
|
|
|||||||
me neither |
||||||||
|
|
|||||||
|
||||||||
|
|
|||||||
wow. I totally forgot. maciep indeed decided not to post |
||||||||
|
|
|||||||
I got so lost during the private round and I saw the scores everyone else was getting. So, I just gave up. |
||||||||
|
|
|||||||
yea... with the results of the tournament, I wouldn't be holding a new tournament for a while. not enough participants... |
||||||||
|
|
|||||||
Wow I didn't even realize that I somehow got 3rd after all that lol. |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
clear rules? would you actually be playing the next time? |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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... |