|
KiXgolf: Shuttle Puzzle - Public Round
|
|
Gelntlemen, please post your code. The public round has now started and it'll be a free-for-all. So, hack away at your opponents code.
I hope everybody did their research before actuallly coding. If not, your fault. Otherwise, you would have come across the following article The Shuttle Puzzle – A Lesson in Problem Solving . The article contains a complete analysis of the puzzle, the embedded rules for the algorithm, and, yes, the algorithm itself, ready to be translated to KiXtart
Let the games (second part) begin...
|
Lonkero
|
(KiX Master Guru)
|
2006-09-16 01:21 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
that link doesn't work jens...
|
maciep
|
(Korg Regular)
|
2006-09-16 01:30 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Here's my still very golf-able 249 code. For the record, i came up with my algorithm soley based on Jooel's post of the solutions in the private round, so thanks Jooel
Code:
function s($a) dim $,$i,$c,$n $=' ' for $c = 1 to $a $ = 'Wa' + $ + 'aB' next $ = split($,a) $s=join($,'')
$n=1 for $i = 1 to $a*2 for $c=$n*($i-2*($i-$a)*($i>$a))*($i<$a*2) to -$c step -2*$n $[ascan($,' ')] = $[$c+$a] $[$c+$a]=' ' $s=$s+a+join($,'') next $n=-$n next $s=split($s,a) endfunction
I'm leaving for Vegas today, so i'll catch you guys again on Wednesday. Good luck!
|
Lonkero
|
(KiX Master Guru)
|
2006-09-16 01:31 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
and here's my 308: Code:
Function s($i) dim $d,$,$_,$k,$t
$ = " " for $_=1 to $i $=W + $ + B next $t=$
for $i=6 to 9 if $i>5 $_=$_<1 endif for $k=1 to 2 $d = instr($," ") if iif($_,W,B)=substr($,$d+$k-2*$_*$k,1) & ($_ ^ W=substr($,$d-1+2*$_,1)) | $i>5 $i = "B "," W","BW "," BW" $ = left($,$d-1-$_*$k) + $i[2*(1<$k)+$_] + substr($,$d+1+$k-$k*$_) $t = $t + ! + $ $s = split($t,!) $i = 0 EndFunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-16 01:37 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
maciep, your CODE FAILED ALL TESTS.
Code:
Shuttle Puzzle failed all 10 tests (0% correct)
KiXtart KiXtart Version = 4.53 Release Candidate 1 KiXforms Version = KiXGolf Script = kixgolf_shuttle.kix
Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 800 MHz Memory = 760 MB
KiXGolf Scoring Engine Scoring Engine = 3.3
KiXtart Golf Score Tournament = KiXtart Golf: Shuttle Puzzle Processing Start = 2006/09/16 14:37:07.687 Processing End = 2006/09/16 14:37:07.687 Duration = 0000/00/00 00:00:00.000 KiXGolf Score = 249
|
Lonkero
|
(KiX Master Guru)
|
2006-09-16 01:39 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
[edit] found out that my tester was corrupt. thus this code does work and 245 is the leading score. [/edit] but if it does work on some other kixtart version, here is 245
Code:
function s($a) dim $,$i,$c,$n $=' ' for $c = 1 to $a $ = Wa + $ + aB next $ = split($,a) $s=join($,'')
$n=1 for $i = 1 to $a*2 for $c=$n*($i-2*($i-$a)*($i>$a))*($i<$a*2) to -$c step -2*$n $[ascan($,' ')] = $[$c+$a] $[$c+$a]=' ' $s=$s+a+join($,'') next $n=-$n next $s=split($s,a) endfunction
|
maciep
|
(Korg Regular)
|
2006-09-16 01:41 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
It works fine on 4.51. Can't believe i never removed those quotes!
|
Lonkero
|
(KiX Master Guru)
|
2006-09-16 01:42 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
tested with 4.51 (the version you used) and it failed as well.
|
Lonkero
|
(KiX Master Guru)
|
2006-09-16 01:46 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
k, downloaded the latest kixgolf tester and now got with my 245: Code:
Shuttle Puzzle passed all 10 tests (100% correct)
KiXtart KiXtart Version = 4.53 Release Candidate 1 KiXforms Version = KiXGolf Script = kixgolf_shuttle.kix
Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 800 MHz Memory = 760 MB
KiXGolf Scoring Engine Scoring Engine = 3.2
KiXtart Golf Score Tournament = KiXtart Golf: Shuttle Puzzle Processing Start = 2006/09/16 14:45:10.562 Processing End = 2006/09/16 14:45:10.812 Duration = 0000/00/00 00:00:00.250 KiXGolf Score = 245
need to see what changed in the tester.
|
maciep
|
(Korg Regular)
|
2006-09-16 01:48 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
I don't what to tell you, everytime i run it here it passes all of the tests
Code:
Shuttle Puzzle passed all 10 tests (100% correct)
KiXtart KiXtart Version = 4.51 KiXforms Version = KiXGolf Script = kixgolf_shuttle.kix
Computer OS = Windows 2000 Professional CPU = Intel Pentium Model 13 Speed = 1698 MHz Memory = 502 MB
KiXGolf Scoring Engine Scoring Engine = 3.2
KiXtart Golf Score Tournament = KiXtart Golf: Shuttle Puzzle Processing Start = 2006/09/16 07:46:33.260 Processing End = 2006/09/16 07:46:33.641 Duration = 0000/00/00 00:00:00.381 KiXGolf Score = 249
|
maciep
|
(Korg Regular)
|
2006-09-16 01:50 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
What tester were you using?
|
Lonkero
|
(KiX Master Guru)
|
2006-09-16 01:54 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
damn... my bad. damn. should have checked right away. had commented out the valid lines when wanted to quickly test possible shorter resolutions
so, your code indeed worked fine. sorry.
|
maciep
|
(Korg Regular)
|
2006-09-16 01:55 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
By the way, i didn't read the link jens posted, but if you look at the position of the space ' ' with regards to the center of board, a pretty clear pattern appears. Here are those positions for $=1 to 5
Quote:
1 -1 0 1 -1 -2 0 2 1 -1 0 1 -1 -2 0 2 3 1 -1 -3 -2 0 2 1 -1 0 1 -1 -2 0 2 3 1 -1 -3 -4 -2 0 2 4 3 1 -1 -3 -2 0 2 1 -1 0 1 -1 -2 0 2 3 1 -1 -3 -4 -2 0 2 4 5 3 1 -1 -3 -5 -4 -2 0 2 4 3 1 -1 -3 -2 0 2 1 -1 0
|
Lonkero
|
(KiX Master Guru)
|
2006-09-16 01:57 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
don't see no pattern in your pasted list
care to bold the key???
|
Lonkero
|
(KiX Master Guru)
|
2006-09-16 02:00 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
btw, nice to see you got rid of those darn substr()'ngs
my head was too deep in the bushes to find out the correct array patterns. I thought there was no way to get it shorter with arrays so never cared to even look that way.
|
Jochen
|
(KiX Supporter)
|
2006-09-16 02:05 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Arggghhh ... And I thought the end was at 3:00 PM (GMT+1) not 1:00 PM
I just came back from doing the weekend shopping, changed the direction of my loop a bit and got a working code (518 though, but hey)
|
RemcovC
|
(Starting to like KiXtart)
|
2006-09-16 02:16 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Ok here's my 279 code, dont have time right now to golf, but maybe tommorow.
Code:
Function s($) Dim $a,$b,$c,$d,$e,$f,$g $d=" " For $b=1 to $ $d="W"+$d+"B" $a=$a+$+2 Next Redim $s[$a] $=2 For $c=0 to $a $s[$c]=$d $d=Join(Split($d),SubStr($d,$b-1,1)) $d=Left($d,$b-2)+" "+substr($d,$b) $b=$b+$ $e=Iif($a/2>$c+1,1,~) If Abs($)=1 $=-2*$e*$ Else If $f $f=$f-1 Else $=$*$e/2 $g=$g+$e $f=$g EndFunction
|
RemcovC
|
(Starting to like KiXtart)
|
2006-09-16 02:17 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Lol im no stranger anymore.... im newbie now
|
Jochen
|
(KiX Supporter)
|
2006-09-16 02:20 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Congrats Remco!!! I predict the status to change soon
So, I now go back silently crying in my pillow
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Corrected the link. Will run the scripts through validation later today.
And anybody who plays a round of KiXgolf deserves to be more than a Stranger/Newbie
|
RemcovC
|
(Starting to like KiXtart)
|
2006-09-16 02:24 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
ok ok..... removed some qoutes, 275 now
Code:
Function s($) Dim $a,$b,$c,$d,$e,$f,$g $d=" " For $b=1 to $ $d=W+$d+B $a=$a+$+2 Next Redim $s[$a] $=2 For $c=0 to $a $s[$c]=$d $d=Join(Split($d),SubStr($d,$b-1,1)) $d=Left($d,$b-2)+" "+Substr($d,$b) $b=$b+$ $e=Iif($a/2>$c+1,1,~) If Abs($)=1 $=-2*$e*$ Else If $f $f=$f-1 Else $=$*$e/2 $g=$g+$e $f=$g EndFunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-16 02:46 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
remco, here's 272 of your code: Code:
Function s($) Dim $a,$b,$c,$d,$e,$f,$g $d=" " For $b=1 to $ $d=W+$d+B $a=$a+$+2 Next Redim $s[$a] $=2 For $c=0 to $a $s[$c]=$d $d=Join(Split($d),SubStr($d,$b-1,1)) $d=Left($d,$b-2)+" "+Substr($d,$b) $b=$b+$ $e=2*($a/2>$c+1)-1 If Abs($)=1 $=-2*$e*$ Else If $f $f=$f-1 Else $=$*$e/2 $g=$g+$e $f=$g EndFunction
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Here's my 360:
Code:
Function s($n) ReDim $s[$n*($n+2)], $, $a, $b, $r
; get directions $ = " " For $a = -$n+1 to $n-1 If $a < 1 $r = $r + $ + 1 $ = iif($ = "-", " ", "-") EndIf For $b = 1 to $n-abs($a) $r = $r + $ + 2 Next If $a > -1 $ = iif($ = "-", " ", "-") $r = $r + $ + 1 EndIf Next
; build first line For $a = 1 to $n $ = "W" + $ + "B" Next $s[0] = $
; build result For $a = 1 to Len($r) step 2 $ = $s[$a/2]
$b = InStr($," ") + Substr($r, $a, 2) $ = join(Split($), Substr($, $b, 1)) $s[$a/2 + 1] = Left($, $b - 1) + " " + Substr($, $b + 1) EndFunction
Damn... I should have googled more for that algorithm
|
Lonkero
|
(KiX Master Guru)
|
2006-09-16 03:15 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
damn maciep, your code is as cryptic as ever. can't get the logic solved out by simply taking a look at it.
|
Lonkero
|
(KiX Master Guru)
|
2006-09-16 03:18 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
244 Code:
function s($a) dim $,$i,$c,$n,$t $=' ' for $c = 1 to $a $ = Wa + $ + aB next $ = split($,a) $t=join($,'')
$n=1 for $i = 1 to $a*2 for $c=$n*($i-2*($i-$a)*($i>$a))*($i<$a*2) to -$c step -2*$n $[ascan($,' ')] = $[$c+$a] $[$c+$a]=' ' $t=$t+a+join($,'') $s=split($t,a) next $n=-$n endfunction
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Quote:
By the way, i didn't read the link jens posted, but if you look at the position of the space ' ' with regards to the center of board, a pretty clear pattern appears. Here are those positions for $=1 to 5
Quote: --------------------------------------------------------------------------------
1 -1 0 1 -1 -2 0 2 1 -1 0 1 -1 -2 0 2 3 1 -1 -3 -2 0 2 1 -1 0 1 -1 -2 0 2 3 1 -1 -3 -4 -2 0 2 4 3 1 -1 -3 -2 0 2 1 -1 0 1 -1 -2 0 2 3 1 -1 -3 -4 -2 0 2 4 5 3 1 -1 -3 -5 -4 -2 0 2 4 3 1 -1 -3 -2 0 2 1 -1 0
pretty clear??? to me this is about as logical as a RND()
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
240: Code:
function s($a) dim $,$i,$c,$n,$t $=' ' for $c = 1 to $a $ = Wa + $ + aB next $ = split($,a) $t=join($,'')
$n=1 for $i = 1 to $a*2 $n=-$n for $c=$n*($i-2*($i-$a)*($i>$a))*($i<$a*2) to -$c step -2*$n $[ascan($,' ')] = $[$c+$a] $[$c+$a]=' ' $t=$t+a+join($,'') $s=split($t,a) EndFunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-16 03:27 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
239 Code:
function s($a) dim $,$i,$c,$n,$t $=' ' for $n = -$a+1 to 0 $ = Wa + $ + aB next $ = split($,a) $t=join($,'')
for $i = 1 to $a*2 $n=-$n for $c=$n*($i-2*($i-$a)*($i>$a))*($i<$a*2) to -$c step -2*$n $[ascan($,' ')] = $[$c+$a] $[$c+$a]=' ' $t=$t+a+join($,'') $s=split($t,a) endfunction
|
Jochen
|
(KiX Supporter)
|
2006-09-16 03:50 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Right Gentlemen, for what's it worth anyway, I'll just post, beyond competition, my 472(changed last case condition to case 1)
Code:
function s($) dim $![$+$*($+1)], $_, $0, $1 $![0] = " " for $_ = 1 to $ $![0] = "W" + $![0] + "B" next for $_ = 1 to ubound($!) $ = split($![$_-1]," ") $0 = right($[0],1) $1 = left($[1],1) select case instr($[1],"B")=2 and $1 = "W" ;^B $![$_] = $[0] + "B" + $1 + " " + right($[1],-2) case ($0 = "B" and $1 = "B" and instr($[0],'W')) or ($0 = "B" and instr($[1],'B') = 0) ;W^ $![$_] = left($[0],-2) + " " + $0 + "W" + $[1] case $0 = "W" and ( instr($[0],"B")=0 or instr($[1],"B")=0 ) ;W-> $![$_] = left($[0],~) + " W" + $[1] case 1 ;<-B $![$_] = $[0] + "B " + right($[1],~) endselect next $s = $! endfunction
that is :
Code:
Shuttle Puzzle passed all 10 tests (100% correct)
KiXtart KiXtart Version = 4.52 KiXforms Version = KiXGolf Script = KIXGOL~1.KIX
Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 1698 MHz Memory = 1022 MB
KiXGolf Scoring Engine Scoring Engine = 3.2
KiXtart Golf Score Tournament = KiXtart Golf: Shuttle Puzzle Processing Start = 2006/09/16 15:42:24.625 Processing End = 2006/09/16 15:42:24.665 Duration = 0000/00/00 00:00:00.040 KiXGolf Score = 472 Thank you for participating in KiXtart Golf!
Having said that, I wish y'all a superb weekend and successful golfing
|
Benny69
|
(MM club member)
|
2006-09-16 03:51 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Ok, here is the code I started with (652), the first 3 'For' loops create the 'Key' to shifting the marbles then the rest shifts them around.
The 'Key' that is created for the input of 1, 2 and 3 is: W1 B2 W1 W1 B2 B1 W2 W2 B1 B2 W1 W1 B2 B1 W2 W2 W1 B2 B2 B2 W1 W2 W2 B1 B2 W1
The W and B refer to the color to be moved and the number 1 means move the marble 1 space and 2 means jump the marble next to it (move 2 spaces). White marbles will always move right and Black will always move left, so no need for a direction. Code:
Function s($z) Dim $a,$b,$c,$d,$e,$f,$g,$h,$i $b=' ' $c=$z $d=$c For $a=1 to $z $b='W'+$b+'B' $d=''+$c+' '+$d+' '+$c+'' $c=$c-1 $h=$h+'2 ' Next $d=Split($d) $c=$z-1 For $a=1 to $z $h='1 '+$h+'1 ' For $f = 1 to $c $h='2 '+$h+'2 ' Next $c=$c-1 Next $h=Split(Trim($h)) $a=1 For Each $c in $d For $f = 1 to $c $e=IIf($a mod 2,'B','W') $g=$g+$e+$h[$i]+' ' $i=$i+1 Next $a=$a+1 Next $d=Split(Trim($g)) ReDim $g[UBound($d)+1] $g[0]=$b $a=1 For Each $c in $d $f=Split($b)[0] $h=Split($b)[1] $e=Right($c,1) $b=IIf(Left($c,1)='W', IIf($e=1,SubStr($f,1,Len($f)-1)+' W',SubStr($f,1,Len($f)-2)+ ' '+Right($f,1)+'W')+$h,$f+ IIf($e=1,'B '+SubStr($h,2,Len($h)-1),'B'+Left($h,1) +' '+SubStr($h,3,Len($h)-2))) $g[$a]=$b $a=$a+1 ;Next $s=$g EndFunction
Then I changed the to this process (412), the idea is to shift marbles based on the color of the two marbles to the left and right of the center space. Code:
Function s($z) Dim $a,$,$c,$d,$e,$f,$g,$h[1],$i $=' ' $c=' ' For $a=1 to $z $='W'+$+'B' $c='B'+$c+'W' Next $h[0]=$ Do $=Split($) $d=$[0] ;Left $e=$[1] ;Right $f=Right($d,2) ;Right chrs of Left Half $g=Left($e,2) ;Left chrs of Right Half Select Case $f='WB' $=Left($d,Len($d)-2)+' BW'+$e Case $g='WB' $=$d+'BW '+Right($e,Len($e)-2) Case Not($f='W' Or $f='WW') And Left($g,1)='B' $=$d+'B '+Right($e,Len($e)-1) Case 1 $=Left($d,Len($d)-1)+' W'+$e EndSelect $i=$i+1 ReDim preserve $h[$i] $h[$i]=$ Until $=$c $s=$h EndFunction
|
Jochen
|
(KiX Supporter)
|
2006-09-16 04:05 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Interesting Dale,
I just had the time to test the cases for the 4 possible moves. Well, on monday I had 'nuff time to recognize the pattern for the ubound() for any number of marbles: [$+$*($+1)]
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Jochen, this is shorter: $*($+2)
|
Benny69
|
(MM club member)
|
2006-09-16 07:43 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
here is my code trimed down to 368: Code:
Function s($z) Dim $a,$,$c,$d,$e,$f,$g,$h[$z*($z+2)] $=' ' $c=' ' For $a=1 to $z $=W+$+B Next For $a = 0 to $z*($z+2) $h[$a]=$ $=Split($) $d=$[0] ;Left $e=$[1] ;Right $f=Right($d,2) ;Right chrs of Left Half $g=Left($e,2) ;Left chrs of Right Half Select Case $f=WB $=Left($d,Len($d)-2)+' BW'+$e Case $g=WB $=$d+'BW '+Right($e,Len($e)-2) Case Not($f=W Or $f=WW) And Left($g,1)=B $=$d+'B '+Right($e,Len($e)-1) Case 1 $=Left($d,Len($d)-1)+' W'+$e EndSelect Next $s=$h EndFunction
|
Witto
|
(MM club member)
|
2006-09-16 07:48 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Here is my code. I do not think someone wants to reuse it. My logic was: example if input is 3 starting position = -3 -2 -1 0 1 2 3 Then some code to get to the ending position = 1 2 3 0 -3 -2 -1 Then swap numbers 0 = ' ' <0 = 'W' >0 = 'B' Code:
Function s($) Dim $j, $k, $b, $v Dim $a[$+$] For $j = 0 to $+$ $a[$j] = ~$+1+$j Next
$s = d($s,$a) For $k = 1 to $ For $j = 1 to $k $a = c($j,$a) $s = d($s,$a) Next If $ > $k $k=$k+1 EndIf For $j = -1 to ~$k+1 step -1 $a = c($j,$a) $s = d($s,$a) Next Next If NOT $ MOD 2 For $j = 1 to $ $a = c($j,$a) $s = d($s,$a) Next EndIf If $ MOD 2 For $k = -1 to ~$+1 step -1 For $j = ~$k+1 to $ $a = c($j,$a) $s = d($s,$a) Next If ~$+1 < $k $k=$k-1 EndIf If NOT $k = ~$+1 For $j = $k to ~$+1 step -1 $a = c($j,$a) $s = d($s,$a) Next EndIf Next Else For $k = -1 to ~$+1 step -1 For $j = $k to ~$+1 step -1 $a = c($j,$a) $s = d($s,$a) Next If ~$+1 < $k $k=$k-1 EndIf For $j = ~$k+1 to $ $a = c($j,$a) $s = d($s,$a) Next Next EndIf $s=Split($s,"-") EndFunction
Function c($j,$a) Dim $b,$v $b = AScan($a,0) $v = AScan($a,$j) $a[$b]=$j $a[$v]=0 $c = $a EndFunction
Function d($s,$a) Dim $j If $s $s = $s + "-" EndIf For Each $j In $a Select Case $j < 0 $s = $s + "W" Case $j = 0 $s = $s + " " Case $j > 0 $s = $s + "B" EndSelect Next $d = $s EndFunction
If you would change <0 = 'B' >0 = 'A' all of the tests will fail... For one or another reason, I was also looking at the Demlo Number... But at the end found nothing that could help me.
|
Lonkero
|
(KiX Master Guru)
|
2006-09-16 08:44 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
witto, does your code work? and if, what's the score???
|
Lonkero
|
(KiX Master Guru)
|
2006-09-16 08:46 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
lol!!! how NOBODY saw this?!?!? 238 Code:
function s($a) dim $,$i,$c,$n,$t $=' ' for $n = 1-$a to 0 $ = Wa + $ + aB next $ = split($,a) $t=join($,'')
for $i = 1 to $a*2 $n=-$n for $c=$n*($i-2*($i-$a)*($i>$a))*($i<$a*2) to -$c step -2*$n $[ascan($,' ')] = $[$c+$a] $[$c+$a]=' ' $t=$t+a+join($,'') $s=split($t,a) endfunction
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Current standings for the public round: Code:
Rank Player Score 1 Jooel 238 2 DrillSergeant 240 Jooel 244 Jooel 245 3 Maciep 249 Jooel 272 4 RemcovC 275 RemcovC 279 Jooel 309 DrillSergeant 360 5 benny69 368 benny69 412 6 Jochen 472 7 Witto 790
|
Lonkero
|
(KiX Master Guru)
|
2006-09-16 09:42 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
anyways, now I'm proud of myself. didn't like the cryptic line of maciep's code, so shrank it: Code:
Shuttle Puzzle passed all 10 tests (100% correct)
KiXtart KiXtart Version = 4.53 Release Candidate 1 KiXforms Version = KiXGolf Script = kixgolf_shuttle.kix
Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 800 MHz Memory = 760 MB
KiXGolf Scoring Engine Scoring Engine = 3.2
KiXtart Golf Score Tournament = KiXtart Golf: Shuttle Puzzle Processing Start = 2006/09/16 22:39:56.031 Processing End = 2006/09/16 22:39:56.265 Duration = 0000/00/00 00:00:00.233 KiXGolf Score = 220
Code:
function s($a) dim $,$i,$c,$n,$t $=' ' for $n = 1-$a to 0 $ = Wa + $ + aB next $ = split($,a) $t=join($,'')
for $i = -$a+1 to $a $n=-$n for $c=$n*($a-abs($i)) to -$c step -2*$n $[ascan($,' ')] = $[$c+$a] $[$c+$a]=' ' $t=$t+a+join($,'') $s=split($t,a) endfunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-16 09:44 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
damn, same mistake again!!! my luck that nobody else is watching this thread
Code:
KiXGolf Score = 219
Code:
function s($a) dim $,$i,$c,$n,$t $=' ' for $n = 1-$a to 0 $ = Wa + $ + aB next $ = split($,a) $t=join($,'')
for $i = 1-$a to $a $n=-$n for $c=$n*($a-abs($i)) to -$c step -2*$n $[ascan($,' ')] = $[$c+$a] $[$c+$a]=' ' $t=$t+a+join($,'') $s=split($t,a) endfunction
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
I'm watching you, naughty Jooel
|
Lonkero
|
(KiX Master Guru)
|
2006-09-16 10:23 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
oh... what makes me naughty???
anyways, 210!!! Code:
function s($a) dim $,$i,$c,$n,$t $=' ' for $n = 1-$a to 0 $ = Wa + $ + aB next $ = split($,a)
for $i = -$a to $a $n=-$n for $c=$n*($a-abs($i)) to -$c step -2*$n $[ascan($,' ')] = $[$c+$a] $[$c+$a]=' ' $t=$t+join($,'') $s=split($t,a) $t=$t+a endfunction
|
RemcovC
|
(Starting to like KiXtart)
|
2006-09-16 11:06 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
damn.... had the same idea, but 3 chars (213) more then you Jooel....
Code:
function s($a) dim $,$i,$c,$n,$t $=' ' for $n = 1-$a to 0 $ = Wa + $ + aB next $ = split($,a) for $i = -$a to $a $n=-$n for $c=$n*($a-abs($i)) to -$c step -2*$n $[ascan($,' ')] = $[$c+$a] $[$c+$a]=' ' $t=$t+join($,'')+a $s=split(Left($t,~),a) endfunction
|
RemcovC
|
(Starting to like KiXtart)
|
2006-09-16 11:07 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Cool.... my new title
Really like it
|
RemcovC
|
(Starting to like KiXtart)
|
2006-09-16 11:09 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Hmmmm....
I want this FOR loop to last 1 extra round (at the end, not the beginning).. But cant seem to figure it out
for $c=$n*($a-abs($i)) to -$c step -2*$n
Any ideas ?
never mind, got it and it was a bad idea
|
Lonkero
|
(KiX Master Guru)
|
2006-09-16 11:17 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
what you mean extra round?
|
RemcovC
|
(Starting to like KiXtart)
|
2006-09-16 11:17 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
i meant 1 extra loop, you can do it by adding $n to -$c.... but it doesnt do what i hoped it would do
|
Lonkero
|
(KiX Master Guru)
|
2006-09-16 11:18 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
you got idea for cutting?
I think next task is to combine the for loops...
|
RemcovC
|
(Starting to like KiXtart)
|
2006-09-16 11:21 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
You mean something like in my code, 1 loop ?
|
Lonkero
|
(KiX Master Guru)
|
2006-09-16 11:25 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
yup. actually, your code has some potential, but not sure if one could ever shave 65 from it.
|
RemcovC
|
(Starting to like KiXtart)
|
2006-09-16 11:29 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
I was thinking more of trying to get rid of this line:
$ = split($,a)
|
Lonkero
|
(KiX Master Guru)
|
2006-09-17 12:12 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
hmm... can't really get rid of it without reworking the whole logic.
|
RemcovC
|
(Starting to like KiXtart)
|
2006-09-17 12:14 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
yeah, came to that conclusion to, think its time to go to bed, maybe tommorow, when im sober again thinking goes smoother
|
Lonkero
|
(KiX Master Guru)
|
2006-09-17 11:38 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
hmm... I think public code rating should only accept the standings of private round golf scores and the ever changing lead score. otherwise anyone can edit the code just a bit to get to the second place. Code:
Rank Player Score 1 Jooel 210 2 RemcovC 213 Jooel 219 Jooel 220 Jooel 238 3 DrillSergeant 240 Jooel 244 Jooel 245 4 Maciep 249 Jooel 272 RemcovC 275 RemcovC 279 Jooel 309 DrillSergeant 360 5 benny69 368 benny69 412 6 Jochen 472 7 Witto 790
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
In order to get to second place, somebody's code needs to be improved to be below 213. Plus, only the best score from each person counts, thus incremental improvements don't do much good. I think the ranking is still fair as one has to do something in order to get higher in the ranking.
|
Lonkero
|
(KiX Master Guru)
|
2006-09-17 01:41 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
do something? adding extra stroke to the leading code would come up with 211. how fair is that?
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Adding a stroke would not get counted, you will have to decrease the count.
|
Benny69
|
(MM club member)
|
2006-09-17 03:40 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
little more, 346 Code:
Function s($z) Dim $,$a,$b,$c,$d,$e,$f[$z*($z+2)] $=' ' For $a=1 to $z $=W+$+B Next For $a=0 to $z*($z+2) $f[$a]=$ $=Split($) $b=$[0] ;Left $c=$[1] ;Right $d=Right($b,2) ;Right chrs of Left Half $e=Left($c,2) ;Left chrs of Right Half Select Case $d=WB $=Left($b,Len($b)-2)+' BW'+$c Case $e=WB $=$b+'BW '+Right($c,Len($c)-2) Case Not($d=W Or $d=WW) And Left($e,1)=B $=$b+'B '+Right($c,Len($c)-1) Case 1 $=Left($b,Len($b)-1)+' W'+$c ;EndSelect ;Next $s=$f EndFunction
|
Benny69
|
(MM club member)
|
2006-09-17 04:06 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Jochen, I just noticed that you and I had the same idea. Great minds,...
|
Witto
|
(MM club member)
|
2006-09-18 12:26 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Jooel, sorry for the confusion. My code works. You can test it. I shaved it a bit. Code:
Function s($) Dim $j, $k, $b, $v Dim $a[$+$] For $j = 0 to $+$ $a[$j] = $j-$ Next
$s = d($s,$a) For $k = 1 to $ For $j = 1 to $k $a = c($j,$a) $s = d($s,$a) Next If $ > $k $k=$k+1 EndIf For $j = -1 to -$k step -1 $a = c($j,$a) $s = d($s,$a) Next Next If NOT $ MOD 2 For $j = 1 to $ $a = c($j,$a) $s = d($s,$a) Next EndIf If $ MOD 2 For $k = -1 to -$ step -1 For $j = -$k to $ $a = c($j,$a) $s = d($s,$a) Next If -$ < $k $k=$k-1 EndIf If NOT $k = -$ For $j = $k to -$ step -1 $a = c($j,$a) $s = d($s,$a) Next EndIf Next Else For $k = -1 to -$ step -1 For $j = $k to -$ step -1 $a = c($j,$a) $s = d($s,$a) Next If -$ < $k $k=$k-1 EndIf For $j = -$k to $ $a = c($j,$a) $s = d($s,$a) Next Next EndIf $s=Split($s,a) EndFunction
Function c($j,$a) Dim $b,$v $b = AScan($a,0) $v = AScan($a,$j) $a[$b]=$j $a[$v]=0 $c = $a EndFunction
Function d($s,$a) Dim $j If $s $s = $s + a EndIf For Each $j In $a Select Case $j < 0 $s = $s + W Case $j = 0 $s = $s + " " Case $j > 0 $s = $s + B EndSelect Next $d = $s EndFunction
Code:
Shuttle Puzzle passed all 10 tests (100% correct)
KiXtart KiXtart Version = 4.53 KiXforms Version = KiXGolf Script = kixgolf_shuttle.kix
Computer OS = Windows XP Professional CPU = Intel(R) Pentium(R) 4 CPU 3.00GHz Speed = 2992 MHz Memory = 512 MB
KiXGolf Scoring Engine Scoring Engine = 3.2
KiXtart Golf Score Tournament = KiXtart Golf: Shuttle Puzzle Processing Start = 2006/09/17 23:34:15.328 Processing End = 2006/09/17 23:34:15.500 Duration = 0000/00/00 00:00:00.172 KiXGolf Score = 759 Thank you for participating in KiXtart Golf!
|
Witto
|
(MM club member)
|
2006-09-18 12:36 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Jochen, can I help shaving your code? It would maybe bring me to the 6th place...
|
Les
|
(KiX Master)
|
2006-09-18 01:53 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
No need to ask. Shave one stroke and it is your's to post.
|
Witto
|
(MM club member)
|
2006-09-18 07:18 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Well, if you say so. Code:
Function s($) Dim $_, $0, $1 ReDim $s[($+1)*$+$] $s[0] = " " For $_ = 1 to $ $s[0] = W + $s[0] + B Next For $_ = 1 to Ubound($s) $ = Split($s[$_-1]," ") $0 = Right($[0],1) $1 = Left($[1],1) Select Case InStr($[1],B)=2 AND $1 = W ;^B $s[$_] = $[0] + B + $1 + " " + Right($[1],-2) Case ($0 = B AND $1 = B AND InStr($[0],W)) OR ($0 = B AND InStr($[1],B) = 0) ;W^ $s[$_] = Left($[0],-2) + " " + $0 + W + $[1] Case $0 = W AND ( InStr($[0],B)=0 OR InStr($[1],B)=0) ;W-> $s[$_] = Left($[0],~) + " W" + $[1] Case 1 ;<-B $s[$_] = $[0] + "B " + Right($[1],~) ;EndSelect ;Next EndFunction
Code:
Shuttle Puzzle passed all 10 tests (100% correct)
KiXtart KiXtart Version = 4.53 KiXforms Version = KiXGolf Script = kixgolf_shuttle.kix
Computer OS = Windows XP Professional CPU = Intel(R) Pentium(R) 4 CPU 3.00GHz Speed = 2992 MHz Memory = 512 MB
KiXGolf Scoring Engine Scoring Engine = 3.2
KiXtart Golf Score Tournament = KiXtart Golf: Shuttle Puzzle Processing Start = 2006/09/18 07:13:36.218 Processing End = 2006/09/18 07:13:36.296 Duration = 0000/00/00 00:00:00.077 KiXGolf Score = 430 Thank you for participating in KiXtart Golf!
It is just that these things were so easy.
|
Jochen
|
(KiX Supporter)
|
2006-09-18 07:55 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Quote:
Current standings for the public round: Code:
Rank Player Score 1 Jooel 238 2 DrillSergeant 240 Jooel 244 Jooel 245 3 Maciep 249 Jooel 272 4 RemcovC 275 RemcovC 279 Jooel 309 DrillSergeant 360 5 benny69 368 benny69 412 6 Jochen 472 7 Witto 790
So that means I can compete with my 'non-private' code (had it ready before end of private round, but missed the deadline for about one hour) ?
|
NTDOC
|
(KiX Master)
|
2006-09-18 08:13 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
I don't recall any rules about those not playing in the private round not being able to play in the public round.
Granted it would be impossible to win overall, but as I see it anyone can play in public round.
Also, if someone trims points off of code you or anyone else posts then they then get a lower score than the poster until such time as the poster or someone else posts lower code.
There is no PROPRIETARY RIGHTS to the code just as there was not in the PERLGolf challenges.
I'm not going to go back and read all the rules now, but I don't remember any rules like that, but if there are then I think they should be removed to be in the real spirit of the Perl Challenge this is modeled after.
|
Jochen
|
(KiX Supporter)
|
2006-09-18 08:44 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Right, if you say so, here's 414 of mine
Code:
function s($) dim $_, $0, $1, $2 redim $s[$*($+2)] $s[0] = " " for $_ = 1 to $ $s[0] = W+$s[0]+B next for $_ = 1 to ubound($s) $ = split($s[$_-1]," ") $0 = right($[0],1) $1 = left($[1],1) $2 = instr($[1],B) select case $2=2 and $1=W ;^B $s[$_] = $[0]+B+$1+" "+right($[1],-2) case ($0=B and $1=B and instr($[0],W)) or ($0=B and $2=0) ;W^ $s[$_] = left($[0],-2)+" "+$0+W+$[1] case $0=W and (instr($[0],B)=0 or $2=0) ;W-> $s[$_] = left($[0],~)+" W"+$[1] case 1 ;<-B $s[$_] = $[0]+"B "+right($[1],~) ;endselect ;next endfunction
Code:
Shuttle Puzzle passed all 10 tests (100% correct)
KiXtart KiXtart Version = 4.53 KiXforms Version = KiXGolf Script = KIXGOL~1.KIX
Computer OS = Windows 2000 Professional CPU = Intel(R) Pentium(R) 4 CPU 2.80GHz Speed = 2793 MHz Memory = 504 MB
KiXGolf Scoring Engine Scoring Engine = 3.2
KiXtart Golf Score Tournament = KiXtart Golf: Shuttle Puzzle Processing Start = 2006/09/18 08:40:50.296 Processing End = 2006/09/18 08:40:50.609 Duration = 0000/00/00 00:00:00.313 KiXGolf Score = 414 Thank you for participating in KiXtart Golf!
|
RemcovC
|
(Starting to like KiXtart)
|
2006-09-18 09:07 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Quote:
do something? adding extra stroke to the leading code would come up with 211. how fair is that?
I know i'm new here, but I just want to give my opinion on this issue anyway
I totally agree with Jooel. It's easy to take the lead score and modify it so you get 1 stroke more. I can't count the times, in which I changed the lead script and got a 210 or a 211 as score.
I hadn't expected that my score of 213 counted, I dont think it's fair to do so. Jooel beat me with 210 half an hour earlier with the same (and even shorter) solution.
|
Jochen
|
(KiX Supporter)
|
2006-09-18 09:44 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
410
should RTFM from time to time
Code:
function s($) dim $_, $0, $1, $2 redim $s[$*($+2)] $s[0] = " " for $_ = 1 to $ $s[0] = W+$s[0]+B next for $_ = 1 to ubound($s) $ = split($s[$_-1]) $0 = right($[0],1) $1 = left($[1],1) $2 = instr($[1],B) select case $2=2 and $1=W ;^B $s[$_] = $[0]+B+$1+" "+right($[1],-2) case ($0=B and $1=B and instr($[0],W)) or ($0=B and $2=0) ;W^ $s[$_] = left($[0],-2)+" "+$0+W+$[1] case $0=W and (instr($[0],B)=0 or $2=0) ;W-> $s[$_] = left($[0],~)+" W"+$[1] case 1 ;<-B $s[$_] = $[0]+"B "+right($[1],~) ;endselect ;next endfunction
|
NTDOC
|
(KiX Master)
|
2006-09-18 09:49 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Well I don't agree and neither did the PERL community.
Bottom line is - IF someone somehow was able to write/re-write his/her or YOUR code and make it smaller, then they were able to think up something you were not able to think up (at least at the time).
That is sort of the whole idea of public coding, not to just see if you can lower your own code, but to get the lowest regardless of who's code used.
|
Jochen
|
(KiX Supporter)
|
2006-09-18 10:11 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
I am fully with you there Ron; The only problem for me is that I have a hard time to even understand what I myself coded
|
Lonkero
|
(KiX Master Guru)
|
2006-09-18 11:30 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
remco, your score actually was the reason why I started thinking about it. I know you were coding with the same base code as I and you didn't just copycat my modifications, thus, I think you should have that score. anyways... if someone takes the leading code and takes another approach with it and that adds to the score, he still has almost leading score with his code. it shouldn't be accepted though. so, think this comes to trust in the end. if allowing higher scores, one has to be able to trust that no misbehavior occurs.
someone might remember way back when some nameless regular posted very low score with: Code:
function blaah($input) $blaah = readprofilestring("kixgolf.ini",$input,"correct answer") endfunction
|
RemcovC
|
(Starting to like KiXtart)
|
2006-09-18 12:10 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Shaved 3 of you're code Code:
function s($) dim $_, $0, $1, $2 redim $s[$*($+2)] $s[0] = " " for $_ = 1 to $ $s[0] = W+$s[0]+B next for $_ = 1 to $*($+2) ; = ubound($s) $ = Split($s[$_-1]) $0 = right($[0],1) $1 = left($[1],1) $2 = instr($[1],B) select case $2=2 and $1=W ;^B $s[$_] = $[0]+B+$1+" "+right($[1],-2) case ($0=B and $1=B and instr($[0],W)) or ($0=B and $2=0) ;W^ $s[$_] = left($[0],-2)+" "+$0+W+$[1] case $0=W and (instr($[0],B)=0 or $2=0) ;W-> $s[$_] = left($[0],~)+" W"+$[1] case 1 ;<-B $s[$_] = $[0]+"B "+right($[1],~) ;endselect ;next endfunction
|
Jochen
|
(KiX Supporter)
|
2006-09-18 01:01 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
yay, obviously
2 more makes 405 :
Code:
function s($) dim $_, $0, $1, $2 redim $s[$*($+2)] $s[0] = " " for $_ = 1 to $ $s[0] = W+$s[0]+B next for $_ = 1 to $*($+2) $ = split($s[$_-1]) $0 = right($[0],1) $1 = left($[1],1) $2 = instr($[1],B) select case $2 and $1=W ;^B $s[$_] = $[0]+B+$1+" "+right($[1],-2) case ($0=B and $1=B and instr($[0],W)) or ($0=B and $2=0) ;W^ $s[$_] = left($[0],-2)+" "+$0+W+$[1] case $0=W and (instr($[0],B)=0 or $2=0) ;W-> $s[$_] = left($[0],~)+" W"+$[1] case 1 ;<-B $s[$_] = $[0]+"B "+right($[1],~) ;endselect ;next endfunction
Code:
Shuttle Puzzle passed all 10 tests (100% correct)
KiXtart KiXtart Version = 4.53 KiXforms Version = KiXGolf Script = KIXGOL~1.KIX
Computer OS = Windows 2000 Professional CPU = Intel(R) Pentium(R) 4 CPU 2.80GHz Speed = 2793 MHz Memory = 504 MB
KiXGolf Scoring Engine Scoring Engine = 3.2
KiXtart Golf Score Tournament = KiXtart Golf: Shuttle Puzzle Processing Start = 2006/09/18 13:07:51.812 Processing End = 2006/09/18 13:07:52.265 Duration = 0000/00/00 00:00:00.453 KiXGolf Score = 405 Thank you for participating in KiXtart Golf!
|
Jochen
|
(KiX Supporter)
|
2006-09-18 01:26 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
402
Code:
function s($) dim $_, $0, $1, $2 redim $s[$*($+2)] $s[0] = " " for $_ = 1 to $ $s[0] = W+$s[0]+B next for $_ = 1 to $*($+2) $ = split($s[$_-1]) $0 = right($[0],1) $1 = left($[1],1) $2 = instr($[1],B) select case $2 and $1=W ;^B $s[$_] = $[0]+B+$1+" "+right($[1],-2) case (BB=$0+$1 and instr($[0],W)) or ($0=B and $2=0) ;W^ $s[$_] = left($[0],-2)+" "+$0+W+$[1] case $0=W and (instr($[0],B)=0 or $2=0) ;W-> $s[$_] = left($[0],~)+" W"+$[1] case 1 ;<-B $s[$_] = $[0]+"B "+right($[1],~) ;endselect ;next endfunction
Code:
Shuttle Puzzle passed all 10 tests (100% correct)
KiXtart KiXtart Version = 4.53 KiXforms Version = KiXGolf Script = KIXGOL~1.KIX
Computer OS = Windows 2000 Professional CPU = Intel(R) Pentium(R) 4 CPU 2.80GHz Speed = 2793 MHz Memory = 504 MB
KiXGolf Scoring Engine Scoring Engine = 3.2
KiXtart Golf Score Tournament = KiXtart Golf: Shuttle Puzzle Processing Start = 2006/09/18 13:23:22.359 Processing End = 2006/09/18 13:23:22.796 Duration = 0000/00/00 00:00:00.437 KiXGolf Score = 402 Thank you for participating in KiXtart Golf!
|
Benny69
|
(MM club member)
|
2006-09-18 01:59 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
thanks Jochen, 345 Code:
Function s($z) Dim $,$a,$b,$c,$d,$e ReDim $s[$z*($z+2)] $=' ' For $a=1 to $z $=W+$+B Next For $a=0 to $z*($z+2) $s[$a]=$ $=Split($) $b=$[0] ;Left $c=$[1] ;Right $d=Right($b,2) ;Right chrs of Left Half $e=Left($c,2) ;Left chrs of Right Half Select Case $d=WB $=Left($b,Len($b)-2)+' BW'+$c Case $e=WB $=$b+'BW '+Right($c,Len($c)-2) Case Not($d=W Or $d=WW) And Left($e,1)=B $=$b+'B '+Right($c,Len($c)-1) Case 1 $=Left($b,Len($b)-1)+' W'+$c ;EndSelect ;Next EndFunction
|
Jochen
|
(KiX Supporter)
|
2006-09-18 02:16 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Hey, you're welcome
|
RemcovC
|
(Starting to like KiXtart)
|
2006-09-18 02:21 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
341 for you benny
Code:
Function s($z) Dim $,$a,$b,$c,$d,$e $=' ' For $a=1 to $z $=W+$+B $b=$b+$z+2 Next ReDim $s[$b] For $a=0 to $b $s[$a]=$ $=Split($) $b=$[0] ;Left $c=$[1] ;Right $d=Right($b,2) ;Right chrs of Left Half $e=Left($c,2) ;Left chrs of Right Half Select Case $d=WB $=Left($b,Len($b)-2)+' BW'+$c Case $e=WB $=$b+'BW '+Right($c,Len($c)-2) Case Not($d=W Or $d=WW) And Left($e,1)=B $=$b+'B '+Right($c,Len($c)-1) Case 1 $=Left($b,Len($b)-1)+' W'+$c ;EndSelect ;Next EndFunction/Code:
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Jeez, you guys make me log in from work.
Rule 8) states that in the public round anybody can re-use anybody's code. This means that somebody who missed the private round submission deadline can still submit his code and have it count in the public round. This also means that anybody can take any of the codes posted in the public round and improve the code base to gain a better score. However, taking e.g. the best-scoring code, adding a stroke to then make second place will not count. You must improve the score in order to have it counted, plus only the best submission by any coder will count. Thus, nobody could take over multiple spots in the ranking.
Hope this clears it up.
|
RemcovC
|
(Starting to like KiXtart)
|
2006-09-18 02:44 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
And kicking a var brings benny's code down to 338
Code:
Function s($z) Dim $,$a,$b,$c,$d $=' ' For $a=1 to $z $=W+$+B $b=$b+$z+2 Next ReDim $s[$b] For $a=0 to $b $s[$a]=$ $=Split($) $b=$[0] ;Left $c=$[1] ;Right $d=Right($b,2) ;Right chrs of Left Half $z=Left($c,2) ;Left chrs of Right Half Select Case $d=WB $=Left($b,Len($b)-2)+' BW'+$c Case $z=WB $=$b+'BW '+Right($c,Len($c)-2) Case Not($d=W Or $d=WW) And Left($z,1)=B $=$b+'B '+Right($c,Len($c)-1) Case 1 $=Left($b,Len($b)-1)+' W'+$c ;EndSelect ;Next EndFunction
|
Jochen
|
(KiX Supporter)
|
2006-09-18 02:45 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Well, you know Jens,
Anytime I fire kixgolf_nameofthegame.kix the results (Score) will be written to kixgolf_nameofthegame_rules.txt. That makes it hard to study the rules
|
Benny69
|
(MM club member)
|
2006-09-18 03:18 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
go Rem Go!
|
RemcovC
|
(Starting to like KiXtart)
|
2006-09-18 05:35 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Hit myself against my head for missing this:
Left($b,Len($b)-2) = Left ($b,-2)
So bringing the total down to 308
Code:
Function s($z) Dim $,$a,$b,$c,$d $=' ' For $a=1 to $z $=W+$+B $b=$b+$z+2 Next ReDim $s[$b] For $a=0 to $b $s[$a]=$ $=Split($) $b=$[0] ;Left $c=$[1] ;Right $d=Right($b,2) ;Right chrs of Left Half $z=Left($c,2) ;Left chrs of Right Half Select Case $d=WB $=Left($b,-2)+' BW'+$c Case $z=WB $=$b+'BW '+Right($c,-2) Case Not($d=W Or $d=WW) And Left($z,1)=B $=$b+'B '+Right($c,~) Case 1 $=Left($b,~)+' W'+$c ;EndSelect ;Next EndFunction
Code:
Shuttle Puzzle passed all 10 tests (100% correct)
KiXtart KiXtart Version = 4.51 KiXforms Version = KiXGolf Script = kixgolf_shuttle.kix
Computer OS = Windows Server 2003 CPU = AMD Athlon(tm) XP 2000+ Speed = 1670 MHz Memory = 1024 MB
KiXGolf Scoring Engine Scoring Engine = 3.2
KiXtart Golf Score Tournament = KiXtart Golf: Shuttle Puzzle Processing Start = 2006/09/18 17:34:04.064 Processing End = 2006/09/18 17:34:04.486 Duration = 0000/00/00 00:00:00.421 KiXGolf Score = 308
Thank you for participating in KiXtart Golf!
|
RemcovC
|
(Starting to like KiXtart)
|
2006-09-18 05:36 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Quote:
go Rem Go!
You see, some motivation works
|
Lonkero
|
(KiX Master Guru)
|
2006-09-18 06:01 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
267 of remco's code: Code:
Function s($) Dim $a,$b,$c,$d,$e,$f,$g $d=" " For $b=1 to $ $d=W+$d+B $a=$a+$+2 Next Redim $s[$a] $=2 For $c=0 to $a $s[$c]=$d $d=Join(Split($d),SubStr($d,$b-1,1)) $d=Left($d,$b-2)+" "+Substr($d,$b) $b=$b+$ $e=2*($a/2>$c+1)-1 If 1/$ $=-2*$e*$ Else If $f $f=$f-1 Else $=$*$e/2 $g=$g+$e $f=$g EndFunction
|
RemcovC
|
(Starting to like KiXtart)
|
2006-09-18 06:19 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Go Jooel Go
|
Jochen
|
(KiX Supporter)
|
2006-09-18 10:21 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Left($b,Len($b)-2) wtf?
It took way too long to see these
|
RemcovC
|
(Starting to like KiXtart)
|
2006-09-19 08:45 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Benny down to 302 by rewriting the 3rd case statement: Code:
Function s($z) Dim $,$a,$b,$c,$d $=' ' For $a=1 to $z $=W+$+B $b=$b+$z+2 Next ReDim $s[$b] For $a=0 to $b $s[$a]=$ $=Split($) $b=$[0] ;Left $c=$[1] ;Right $d=Right($b,2) ;Right chrs of Left Half $z=Left($c,2) ;Left chrs of Right Half Select Case $d=WB $=Left($b,-2)+' BW'+$c Case $z=WB $=$b+'BW '+Right($c,-2) Case $d<>W & $d<>WW & Left($z,1)=B $=$b+'B '+Right($c,~) Case 1 $=Left($b,~)+' W'+$c ;EndSelect ;Next EndFunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-19 11:19 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
well, here is 294: Code:
Function s($z) Dim $,$a,$b,$c,$d $=' ' For $a=1 to $z $=W+$+B $b=$b+$z+2 Next ReDim $s[$b] For $a=0 to $b $s[$a]=$ $=Split($) $b=$[0] ;Left $c=$[1] ;Right $d=Right($b,2) ;Right chrs of Left Half $z=Left($c,2) ;Left chrs of Right Half Select Case $d=WB $=Left($b,-2)+' BW'+$c Case $z=WB $=$b+'BW '+Right($c,-2) Case $d<W & Left($z,1)=B $=$b+'B '+Right($c,~) Case 1 $=Left($b,~)+' W'+$c EndFunction
|
Jochen
|
(KiX Supporter)
|
2006-09-19 02:57 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Quote:
$d<W
You basta!
|
RemcovC
|
(Starting to like KiXtart)
|
2006-09-19 03:01 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Quote:
$d < w
It won't win a beauty contest, but it gets the job done. Nice one
|
Lonkero
|
(KiX Master Guru)
|
2006-09-19 05:35 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
286. Code:
Function s($a) Dim $,$b,$d,$c $=' ' For $d=1 to $a $=W+$+B $b=$b+$a+2 Next ReDim $s[$b] For $a=0 to $b $s[$a]=$ $=Split($) $b=$[0] ;Left $c=$[1] $d=Right($b,2) ;Right chrs of Left Half Select Case $d=WB $=Left($b,-2)+' BW'+$c Case Left($c,2)=WB $=$b+'BW '+Right($c,-2) Case $d<W & Left($c,1)=B $=$b+'B '+Right($c,~) Case 1 $=Left($b,~)+' W'+$c EndFunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-19 06:03 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
277 Code:
Function s($a) Dim $,$d,$c $=' ' For $d=1 to $a $=W+$+B $c=$c+$a+2 Next ReDim $s[$c] For $a=0 to $c $s[$a]=$ $=Split($) $c=$[1] $=$[0] $d=Right($,2) ;Right chrs of Left Half Select Case $d=WB $=Left($,-2)+' BW'+$c Case Left($c,2)=WB $=$+'BW '+Right($c,-2) Case $d<W & Left($c,1)=B $=$+'B '+Right($c,~) Case 1 $=Left($,~)+' W'+$c EndFunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-19 06:05 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
rotating gives 276
Code:
Function s($a) Dim $,$d,$c $=' ' For $d=1 to $a $=W+$+B $c=$c+$a+2 Next ReDim $s[$c] For $a=0 to $c $s[$a]=$ $=Split($) $c=$[0] $=$[1] $d=Right($c,2) ;Right chrs of Left Half Select Case $d=WB $=Left($c,-2)+' BW'+$ Case Left($,2)=WB $=$c+'BW '+Right($,-2) Case $d<W & Left($,1)=B $=$c+'B '+Right($,~) Case 1 $=Left($c,~)+' W'+$ EndFunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-19 07:21 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
LOL! 275.
Code:
Function s($a) Dim $,$d,$c,$x $=' ' For $d=1 to $a $=W+$+B $c=$c+$a+2 Next ReDim $s[$c] For $a=0 to $c $s[$a]=$ $=Split($) $c=$[0] $=$[1] $d=Right($c,2) ;Right chrs of Left Half Select Case $d=WB $=Left($c,-2)+' BW'+$ Case Left($,2)=WB $=$c+'BW '+Right($,-2) Case $d<W & W>$ & $>a $=$c+'B '+Right($,~) Case 1 $=Left($c,~)+' W'+$ EndFunction
|
Jochen
|
(KiX Supporter)
|
2006-09-19 09:51 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
nice
|
Witto
|
(MM club member)
|
2006-09-19 10:39 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
38 more strokes to shave and you will have had the best appoach. I envy you.
|
Lonkero
|
(KiX Master Guru)
|
2006-09-19 11:02 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
I still don't like the select case thingie... even though it's pretty short, it looks long
|
Witto
|
(MM club member)
|
2006-09-20 12:14 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Apparently I will end up as tailender. I just continue shaving my script 738 Code:
Function s($) Dim $j, $k, $b, $v Dim $a[$+$] For $j = 0 to $+$ $a[$j] = $j-$ Next
$s = d($s,$a) For $k = 1 to $ For $j = 1 to $k $a = c($j,$a) $s = d($s,$a) Next If $ > $k $k=$k+1 EndIf For $j = -1 to -$k step -1 $a = c($j,$a) $s = d($s,$a) Next Next If NOT $ MOD 2 For $j = 1 to $ $a = c($j,$a) $s = d($s,$a) Next EndIf If $ MOD 2 For $k = -1 to -$ step -1 For $j = -$k to $ $a = c($j,$a) $s = d($s,$a) Next If -$ < $k $k=$k-1 EndIf If NOT $k = -$ For $j = $k to -$ step -1 $a = c($j,$a) $s = d($s,$a) Next EndIf Next Else For $k = -1 to -$ step -1 For $j = $k to -$ step -1 $a = c($j,$a) $s = d($s,$a) Next If -$ < $k $k=$k-1 EndIf For $j = -$k to $ $a = c($j,$a) $s = d($s,$a) Next Next EndIf $s=Split($s,a) EndFunction
Function c($j,$a) Dim $b,$v $b = AScan($a,0) $v = AScan($a,$j) $a[$b]=$j $a[$v]=0 $c = $a EndFunction
Function d($s,$a) Dim $j If $s $d = $s + a EndIf For Each $j In $a Select Case $j < 0 $d = $d + W Case $j = 0 $d = $d + " " Case 1;$j > 0 $d = $d + B ;EndSelect ;Next EndFunction
|
Jochen
|
(KiX Supporter)
|
2006-09-20 09:06 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Go Witto, Go!!!
|
Witto
|
(MM club member)
|
2006-09-20 09:10 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Jeeeee, supporters. Thx.
|
Lonkero
|
(KiX Master Guru)
|
2006-09-20 12:01 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
well, here is updated witto's code. 723 Code:
Function s($) Dim $j, $k, $b, $v Dim $a[$+$] For $j = 0 to $+$ $a[$j] = $j-$ Next
$s = d($s,$a) For $k = 1 to $ For $j = 1 to $k $a = c($j,$a) $s = d($s,$a) Next If $ > $k $k=$k+1 EndIf For $j = -1 to -$k step -1 $a = c($j,$a) $s = d($s,$a) Next Next If $ MOD 2 For $k = -1 to -$ step -1 For $j = -$k to $ $a = c($j,$a) $s = d($s,$a) Next If -$ < $k $k=$k-1 EndIf If NOT $k = -$ For $j = $k to -$ step -1 $a = c($j,$a) $s = d($s,$a) Next EndIf Next Else For $j = 1 to $ $a = c($j,$a) $s = d($s,$a) Next For $k = -1 to -$ step -1 For $j = $k to -$ step -1 $a = c($j,$a) $s = d($s,$a) Next If -$ < $k $k=$k-1 EndIf For $j = -$k to $ $a = c($j,$a) $s = d($s,$a) Next Next EndIf $s=Split($s,a) EndFunction
Function c($j,$a) Dim $b,$v $b = AScan($a,0) $v = AScan($a,$j) $a[$b]=$j $a[$v]=0 $c = $a EndFunction
Function d($s,$a) Dim $j If $s $d = $s + a EndIf For Each $j In $a Select Case $j < 0 $d = $d + W Case $j = 0 $d = $d + " " Case 1;$j > 0 $d = $d + B ;EndSelect ;Next EndFunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-20 08:30 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
am I the only golfer around?
672... Code:
Function s($) Dim $j, $k, $b, $v Dim $a[$+$] For $j = 0 to $+$ $a[$j] = $j-$ Next
$s = d($s,$a) For $k = 1 to $ For $j = 1 to $k $a = c($j,$a) $s = d($s,$a) Next $k=$k+($>$k) For $j = -1 to -$k step -1 $a = c($j,$a) $s = d($s,$a) Next Next If $ MOD 2 For $k = -1 to -$ step -1 For $j = -$k to $ $a = c($j,$a) $s = d($s,$a) Next $k=$k-(-$<$k) If NOT $k = -$ For $j = $k to -$ step -1 $a = c($j,$a) $s = d($s,$a) Next EndIf Next Else For $j = 1 to $ $a = c($j,$a) $s = d($s,$a) Next For $k = -1 to -$ step -1 For $j = $k to -$ step -1 $a = c($j,$a) $s = d($s,$a) Next $k=$k-(-$<$k) For $j = -$k to $ $a = c($j,$a) $s = d($s,$a) Next Next EndIf $s=Split($s,a) EndFunction
Function c($,$a) dim $! $! = AScan($a,$) $a[AScan($a,0)]=$ $a[$!]=0 $c = $a EndFunction
Function d($s,$) If $s $d = $s + a EndIf For Each $ In $ $d= $d + substr("W B",1+($=0)+2*($>),1) EndFunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-20 08:42 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
650
Code:
Function s($) Dim $j, $k, $b, $v Dim $a[$+$] For $j = 0 to $+$ $a[$j] = $j-$ Next
$s = d($s,$a) For $k = 1 to $ For $j = 1 to $k $a = c($j,$a) $s = d($s,$a) Next $k=$k+($>$k) For $j = -1 to -$k step -1 $a = c($j,$a) $s = d($s,$a) Next Next If $ MOD 2 For $k = 1 to $ For $j = $k to $ $a = c($j,$a) $s = d($s,$a) Next $k=$k+($>$k) If $k < $ For $j = -$k to -$ step -1 $a = c($j,$a) $s = d($s,$a) Next EndIf Next Else For $j = 1 to $ $a = c($j,$a) $s = d($s,$a) Next For $k = 1 to $ For $j = -$k to -$ step -1 $a = c($j,$a) $s = d($s,$a) Next $k=$k+($>$k) For $j = $k to $ $a = c($j,$a) $s = d($s,$a) Next Next EndIf $s=Split($s,a) EndFunction
Function c($,$a) dim $! $! = AScan($a,$) $a[AScan($a,0)]=$ $a[$!]=0 $c = $a EndFunction
Function d($s,$) If $s $d = $s + a EndIf For Each $ In $ $d= $d + substr("W B",1+($=0)+2*($>),1) EndFunction
|
Benny69
|
(MM club member)
|
2006-09-20 09:24 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Sorry Jooel, It has been crazy around here, hopefuly i can work on things tonight.
|
Witto
|
(MM club member)
|
2006-09-21 01:02 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Jooel I admire your skills as golfer (barber?). You shave them quite short. 646 Code:
Function s($) Dim $j, $k, $b, $v Dim $a[$+$] For $j = 0 to $+$ $a[$j] = $j-$ Next
$s = d($s,$a) For $k = 1 to $ For $j = 1 to $k $a = c($j,$a) $s = d($s,$a) Next $k=$k+($>$k) For $j = -1 to -$k step -1 $a = c($j,$a) $s = d($s,$a) Next Next If $ MOD 2 For $k = 1 to $ For $j = $k to $ $a = c($j,$a) $s = d($s,$a) Next $k=$k+($>$k) If $k < $ For $j = -$k to -$ step -1 $a = c($j,$a) $s = d($s,$a) Next EndIf Next Else For $j = 1 to $ $a = c($j,$a) $s = d($s,$a) Next For $k = 1 to $ For $j = -$k to -$ step -1 $a = c($j,$a) $s = d($s,$a) Next $k=$k+($>$k) For $j = $k to $ $a = c($j,$a) $s = d($s,$a) Next Next EndIf $s=Split($s,a) EndFunction
Function c($a,$) Dim $! $! = AScan($,$a) $[AScan($,0)]=$a $[$!]=0 $c = $ EndFunction
Function d($,$s) If $ $d = $ + a EndIf For Each $ In $s $d= $d + SubStr("W B",1+($=0)+2*($>),1) EndFunction
|
Benny69
|
(MM club member)
|
2006-09-21 02:28 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Witto, 638 Code:
Function s($x) Dim $j,$ Dim $a[$x+$x] For $j = 0 to $x+$x $a[$j] = $j-$x Next
$s = d($s,$a) For $ = 1 to $x For $j = 1 to $ $a = c($j,$a) $s = d($s,$a) Next $=$+($x>$) For $j = -1 to -$ step -1 $a = c($j,$a) $s = d($s,$a) Next Next If $x MOD 2 For $ = 1 to $x For $j = $ to $x $a = c($j,$a) $s = d($s,$a) Next $=$+($x>$) If $ < $x For $j = -$ to -$x step -1 $a = c($j,$a) $s = d($s,$a) Next EndIf Next Else For $j = 1 to $x $a = c($j,$a) $s = d($s,$a) Next For $ = 1 to $x For $j = -$ to -$x step -1 $a = c($j,$a) $s = d($s,$a) Next $=$+($x>$) For $j = $ to $x $a = c($j,$a) $s = d($s,$a) Next Next EndIf $s=Split($s,a) EndFunction
Function c($a,$) Dim $! $! = AScan($,$a) $[AScan($,0)]=$a $[$!]=0 $c = $ EndFunction
Function d($,$s) If $ $d = $ + a EndIf For Each $ in $s $d= $d + SubStr("W B",1+($=)+2*($>),1) EndFunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-21 02:31 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
633 then. Code:
Function s($x) Dim $j,$ Dim $a[$x+$x] For $j = 0 to $x+$x $a[$j] = $j-$x Next
$s = d($s,$a) For $ = 1 to $x For $j = 1 to $ $a = c($j,$a) $s = d($s,$a) Next $=$+($x>$) For $j = -1 to -$ step -1 $a = c($j,$a) $s = d($s,$a) Next Next If $x MOD 2 For $ = 1 to $x For $j = $ to $x $a = c($j,$a) $s = d($s,$a) Next $=$+($x>$) If $ < $x For $j = -$ to -$x step -1 $a = c($j,$a) $s = d($s,$a) Next EndIf Next Else For $j = 1 to $x $a = c($j,$a) $s = d($s,$a) Next For $ = 1 to $x For $j = -$ to -$x step -1 $a = c($j,$a) $s = d($s,$a) Next $=$+($x>$) For $j = $ to $x $a = c($j,$a) $s = d($s,$a) Next Next EndIf $s=Split($s,a) EndFunction
Function c($a,$) $c = AScan($,$a) $[AScan($,0)]=$a $[$c]=0 $c = $ EndFunction
Function d($,$s) If $ $d = $ + a EndIf For Each $ in $s $d= $d + SubStr("W B",1+($=)+2*($>),1) EndFunction
|
Jochen
|
(KiX Supporter)
|
2006-09-21 03:04 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
postpump post ....
631
Code:
Function s($x) Dim $j,$ Dim $a[2*$x] For $j = 0 to 2*$x $a[$j] = $j-$x Next
$s = d($s,$a)
For $ = 1 to $x For $j = 1 to $ $a = c($j,$a) $s = d($s,$a) Next $=$+($x>$) For $j = -1 to -$ step -1 $a = c($j,$a) $s = d($s,$a) Next Next If $x MOD 2 For $ = 1 to $x For $j = $ to $x $a = c($j,$a) $s = d($s,$a) Next $=$+($x>$) If $ < $x For $j = -$ to -$x step -1 $a = c($j,$a) $s = d($s,$a) Next EndIf Next Else For $j = 1 to $x $a = c($j,$a) $s = d($s,$a) Next For $ = 1 to $x For $j = -$ to -$x step -1 $a = c($j,$a) $s = d($s,$a) Next $=$+($x>$) For $j = $ to $x $a = c($j,$a) $s = d($s,$a) Next Next EndIf $s=Split($s,a) EndFunction
Function c($a,$) $c = AScan($,$a) $[AScan($,0)]=$a $[$c]=0 $c = $ EndFunction
Function d($,$s) If $ $d = $ + a EndIf For Each $ in $s $d= $d + SubStr("W B",1+($=)+2*($>),1) EndFunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-21 05:26 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
628, I think. Code:
Function s($x) Dim $j,$,$a[2*$x] For $j = 0 to 2*$x $a[$j] = $j-$x Next
$s = d(0,$a)
For $ = 1 to $x For $j = 1 to $ $a = c($j,$a) $s = d($s,$a) Next $=$+($x>$) For $j = -1 to -$ step -1 $a = c($j,$a) $s = d($s,$a) Next Next If $x MOD 2 For $ = 1 to $x For $j = $ to $x $a = c($j,$a) $s = d($s,$a) Next $=$+($x>$) If $ < $x For $j = -$ to -$x step -1 $a = c($j,$a) $s = d($s,$a) Next EndIf Next Else For $j = 1 to $x $a = c($j,$a) $s = d($s,$a) Next For $ = 1 to $x For $j = -$ to -$x step -1 $a = c($j,$a) $s = d($s,$a) Next $=$+($x>$) For $j = $ to $x $a = c($j,$a) $s = d($s,$a) Next Next EndIf $s=Split($s,a) EndFunction
Function c($a,$) $c = AScan($,$a) $[AScan($,0)]=$a $[$c]=0 $c = $ EndFunction
Function d($,$s) If $ $d = $ + a EndIf For Each $ in $s $d= $d + SubStr("W B",1+($=)+2*($>),1) EndFunction
|
Jochen
|
(KiX Supporter)
|
2006-09-21 06:21 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
You think correct!
|
Lonkero
|
(KiX Master Guru)
|
2006-09-21 07:25 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
k, lets start golfing boys. 595 Code:
Function s($x) Dim $j,$,$a[2*$x] For $j = 0 to 2*$x $a[$j] = $j-$x Next
$s = d(0,$a)
For $ = 1 to $x For $j = 1 to $ $a = c($j,$a) $s = d($s,$a) Next $=$+($x>$) For $j = -1 to -$ step -1 $a = c($j,$a) $s = d($s,$a) Next Next If 0= $x MOD 2 For $j = 1 to $x $a = c($j,$a) $s = d($s,$a) Next endif For $ = 1 to $x If $x MOD 2 For $j = $ to $x $a = c($j,$a) $s = d($s,$a) Next $=$+($x>$) endif If $ < $x For $j = -$ to -$x step -1 $a = c($j,$a) $s = d($s,$a) Next endif If 0= $x MOD 2 $=$+($x>$) For $j = $ to $x $a = c($j,$a) $s = d($s,$a) Next endif Next $s=Split($s,a) EndFunction
Function c($a,$) $c = AScan($,$a) $[AScan($,0)]=$a $[$c]=0 $c = $ EndFunction
Function d($,$s) If $ $d = $ + a EndIf For Each $ in $s $d= $d + SubStr("W B",1+($=)+2*($>),1) EndFunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-21 08:10 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
266 out of remco's code: Code:
Function s($d) Dim $a,$b,$c,$,$e,$f,$g $=" " For $b=1 to $d $=W+$+B $a=$a+$d+2 Next Redim $s[$a] $d=2
For $c=0 to $a $s[$c]=$ $=Join(Split($),SubStr($,$b-1,1)) $=Left($,$b-2)+" "+Substr($,$b) $b=$b+$d $e=2*($a/2>$c+1)-1 If 1/$d $d=-2*$e*$d Else If $f $f=$f-1 Else $d=$d*$e/2 $g=$g+$e $f=$g EndFunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-21 09:11 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
hehee...
554 out of witto's code Code:
Function s($x) Dim $j,$,$a[2*$x] For $j = 0 to 2*$x $a[$j] = $j-$x Next
$s = d(0,$a)
For $ = 1 to $x For $j = 1 to $ $a = c($j,$a) $s = d($s,$a) Next $=$+($x>$) For $j = -1 to -$ step -1 $a = c($j,$a) $s = d($s,$a) Next Next If 0= $x MOD 2 $=1 gosub n endif For $ = 1 to $x If $x MOD 2 gosub n $=$+($x>$) endif If $ < $x For $j = -$ to -$x step -1 $a = c($j,$a) $s = d($s,$a) Next endif If 0= $x MOD 2 $=$+($x>$) gosub n endif Next $s=Split($s,a) exit :n For $j = $ to $x $a = c($j,$a) $s = d($s,$a) Next return EndFunction
Function c($a,$) $c = AScan($,$a) $[AScan($,0)]=$a $[$c]=0 $c = $ EndFunction
Function d($,$s) If $ $d = $ + a EndIf For Each $ in $s $d= $d + SubStr("W B",1+($=)+2*($>),1) EndFunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-21 09:17 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
540 Code:
Function s($x) Dim $j,$,$a[2*$x] For $j = 0 to 2*$x $a[$j] = $j-$x Next
$s = d(0,$a)
For $ = 1 to $x For $j = 1 to $ $a = c($j,$a) $s = d($s,$a) Next $=$+($x>$) For $j = 1 to $ $a = c(-$j,$a) $s = d($s,$a) Next Next If 0= $x MOD 2 $=1 gosub n endif For $ = 1 to $x If $x MOD 2 gosub n $=$+($x>$) endif If $ < $x For $j = $ to $x $a = c(-$j,$a) $s = d($s,$a) Next endif If 0= $x MOD 2 $=$+($x>$) gosub n endif Next $s=Split($s,a) exit :n For $j = $ to $x $a = c($j,$a) $s = d($s,$a) next return EndFunction
Function c($a,$) $c = AScan($,$a) $[AScan($,0)]=$a $[$c]=0 $c = $ EndFunction
Function d($,$s) If $ $d = $ + a EndIf For Each $ in $s $d= $d + SubStr("W B",1+($=)+2*($>),1) EndFunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-21 10:22 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
512 Code:
Function s($x) Dim $j,$,$a[2*$x] For $j = 0 to 2*$x $a[$j] = $j-$x Next
gosub d
For $ = 1 to $x For $j = 1 to $ $a = c($j,$a) gosub d Next $=$+($x>$) For $j = 1 to $ $a = c(-$j,$a) gosub d Next Next If 0= $x MOD 2 $=1 gosub n endif For $ = 1 to $x If $x MOD 2 gosub n $=$+($x>$) endif If $ < $x For $j = $ to $x $a = c(-$j,$a) gosub d Next endif If 0= $x MOD 2 $=$+($x>$) gosub n endif Next $s=Split($s,a) exit :n For $j = $ to $x $a = c($j,$a) gosub d next return :d dim $_ If $s $s = $s + a EndIf For Each $_ in $a $s= $s + SubStr("W B",1+($_=)+2*($_>),1) next return EndFunction
Function c($a,$) $c = AScan($,$a) $[AScan($,0)]=$a $[$c]=0 $c = $ EndFunction
|
Jochen
|
(KiX Supporter)
|
2006-09-21 10:24 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
eh? what was gosub again??
|
Lonkero
|
(KiX Master Guru)
|
2006-09-21 10:28 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
465 Code:
Function s($x) Dim $j,$,$a[2*$x],$p,$_ For $j = 0 to 2*$x $a[$j] = $j-$x Next
gosub d For $ = 1 to $x For $j = 1 to $ $p=1 gosub d Next $=$+($x>$) For $j = 1 to $ $p=-1 gosub d Next Next If 0= $x MOD 2 $=1 gosub n endif For $ = 1 to $x If $x MOD 2 gosub n $=$+($x>$) endif If $ < $x For $j = $ to $x $p=-1 gosub d Next endif If 0= $x MOD 2 $=$+($x>$) gosub n endif Next $s=Split($s,a) exit :n For $j = $ to $x $p=1 gosub d next return :d If $s $_ = AScan($a,$j*$p) $a[AScan($a,0)]=$j*$p $a[$_]=0 $s = $s + a EndIf For Each $_ in $a $s= $s + SubStr("W B",1+($_=)+2*($_>),1) next return EndFunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-21 10:32 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
gosub what?
it's not goto, that's for sure
|
Witto
|
(MM club member)
|
2006-09-21 10:39 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Hey Jooel. Thanks for golfing my code. I had tried these gosubs in the private round, but I presume I did something wrong and made two functions.
|
Lonkero
|
(KiX Master Guru)
|
2006-09-21 10:49 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
458. is there any code that I haven't yet golfed? Code:
Function s($x) Dim $j,$,$a[2*$x],$p,$_ For $j = 0 to 2*$x $a[$j] = $j-$x Next
gosub d For $ = 1 to $x For $j = 1 to $ $p=1 gosub d Next $=$+($x>$) For $j = 1 to $ $p=-1 gosub d Next Next If 0= $x MOD 2 $=1 $p=1 gosub n endif For $ = 1 to $x If $x MOD 2 $p=1 gosub n $=$+($x>$) endif If $ < $x $p=-1 gosub n endif If 0= $x MOD 2 $=$+($x>$) $p=1 gosub n endif Next $s=Split($s,a) exit :n For $j = $ to $x gosub d next return :d If $s $_ = AScan($a,$j*$p) $a[AScan($a,0)]=$j*$p $a[$_]=0 $s = $s + a EndIf For Each $_ in $a $s= $s + SubStr("W B",1+($_=)+2*($_>),1) next return EndFunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-21 10:52 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
hmm... think I don't have benny's or jochen's golf done yet, but imho, they were the same, so didn't see no point golfing them both.
maciep's 210 remco's 266 jochen's/benny's 275 mine 308 witto's 458
anyone care to challenge?
|
Witto
|
(MM club member)
|
2006-09-22 01:08 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Bravo. Really, I am impressed.
|
NTDOC
|
(KiX Master)
|
2006-09-22 01:09 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Stop Witto Stop... His head is growing so large he's starting to force others out of the room
|
Benny69
|
(MM club member)
|
2006-09-22 02:10 AM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
well there is my original code 652. A description of how the code works can be found here. Code:
Function s($z) Dim $a,$b,$c,$d,$e,$f,$g,$h,$i $b=' ' $c=$z $d=$c For $a=1 to $z $b='W'+$b+'B' $d=''+$c+' '+$d+' '+$c+'' $c=$c-1 $h=$h+'2 ' Next $d=Split($d) $c=$z-1 For $a=1 to $z $h='1 '+$h+'1 ' For $f = 1 to $c $h='2 '+$h+'2 ' Next $c=$c-1 Next $h=Split(Trim($h)) $a=1 For Each $c in $d For $f = 1 to $c $e=IIf($a mod 2,'B','W') $g=$g+$e+$h[$i]+' ' $i=$i+1 Next $a=$a+1 Next $d=Split(Trim($g)) ReDim $g[UBound($d)+1] $g[0]=$b $a=1 For Each $c in $d $f=Split($b)[0] $h=Split($b)[1] $e=Right($c,1) $b=IIf(Left($c,1)='W', IIf($e=1,SubStr($f,1,Len($f)-1)+' W',SubStr($f,1,Len($f)-2)+ ' '+Right($f,1)+'W')+$h,$f+ IIf($e=1,'B '+SubStr($h,2,Len($h)-1),'B'+Left($h,1) +' '+SubStr($h,3,Len($h)-2))) $g[$a]=$b $a=$a+1 ;Next $s=$g EndFunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-22 06:24 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
well... here is 640 Code:
Function s($z) Dim $a,$b,$c,$d,$e,$f,$g,$h,$i $b=' ' $d=$z For $c=$z to 1 step -1 $b='W'+$b+'B' $d=''+$c+' '+$d+' '+$c+'' $h=$h+'2 ' Next $d=Split($d) For $c=$z-1 to 0 step -1 $h='1 '+$h+'1 ' For $f = 1 to $c $h='2 '+$h+'2 ' Next Next $h=Split(Trim($h)) $a=1 For Each $c in $d For $z = 1 to $c $e=IIf($a mod 2,'B','W') $g=$g+$e+$h[$i]+' ' $i=$i+1 Next $a=$a+1 Next $d=Split(Trim($g)) ReDim $g[UBound($d)+1] $g[0]=$b $a=1 For Each $c in $d $f=Split($b)[0] $h=Split($b)[1] $e=Right($c,1) $b=IIf(Left($c,1)='W', IIf($e=1,SubStr($f,1,Len($f)-1)+' W',SubStr($f,1,Len($f)-2)+ ' '+Right($f,1)+'W')+$h,$f+ IIf($e=1,'B '+SubStr($h,2,Len($h)-1),'B'+Left($h,1) +' '+SubStr($h,3,Len($h)-2))) $g[$a]=$b $a=$a+1 ;Next $s=$g EndFunction
|
Benny69
|
(MM club member)
|
2006-09-22 06:27 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
show off
|
Lonkero
|
(KiX Master Guru)
|
2006-09-22 06:29 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
hey, is there some private round in minigolf? I understood it was public from start...
|
Benny69
|
(MM club member)
|
2006-09-22 06:31 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
i think your right, public only.
|
Benny69
|
(MM club member)
|
2006-09-22 06:34 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
636 Code:
Function s($z) Dim $a,$b,$c,$d,$e,$f,$g,$h,$i $b=' ' $d=$z For $c=$z to 1 step -1 $b='W'+$b+'B' $d=''+$c+' '+$d+' '+$c+'' $h=$h+'2 ' Next $d=Split($d) For $a=$z-1 to 0 step -1 $h='1 '+$h+'1 ' For $f = 1 to $a $h='2 '+$h+'2 ' Next Next $h=Split(Trim($h)) For Each $c in $d For $z = 1 to $c $e=IIf($a mod 2,'B','W') $g=$g+$e+$h[$i]+' ' $i=$i+1 Next $a=$a+1 Next $d=Split(Trim($g)) ReDim $g[UBound($d)+1] $g[0]=$b $a=1 For Each $c in $d $f=Split($b)[0] $h=Split($b)[1] $e=Right($c,1) $b=IIf(Left($c,1)='W', IIf($e=1,SubStr($f,1,Len($f)-1)+' W',SubStr($f,1,Len($f)-2)+ ' '+Right($f,1)+'W')+$h,$f+ IIf($e=1,'B '+SubStr($h,2,Len($h)-1),'B'+Left($h,1) +' '+SubStr($h,3,Len($h)-2))) $g[$a]=$b $a=$a+1 ;Next $s=$g EndFunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-22 06:46 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
well... 592: Code:
Function s($z) Dim $a,$b,$c,$d,$e,$f,$g,$h,$i $b=' ' $d=$z For $c=$z to 1 step -1 $b='W'+$b+'B' $d=''+$c+' '+$d+' '+$c+'' $h=$h+'2 ' Next $d=Split($d) For $a=$z-1 to 0 step -1 $h='1 '+$h+'1 ' For $f = 1 to $a $h='2 '+$h+'2 ' Next Next $h=Split(Trim($h)) For Each $c in $d For $z = 1 to $c $e=IIf($a mod 2,'B','W') $g=$g+$e+$h[$i]+' ' $i=$i+1 Next $a=$a+1 Next $d=Split(Trim($g)) ReDim $g[UBound($d)+1] $g[0]=$b $a=1 For Each $c in $d $h=Split($b) $f=$h[0] $h=$h[1] $e=Right($c,1) $b=IIf(Left($c,1)='W', IIf($e=1,left($f,-1)+' W',left($f,-2)+ ' '+Right($f,1)+'W')+$h,$f+ IIf($e=1,'B '+right($h,-1),'B'+Left($h,1) +' '+right($h,-2))) $g[$a]=$b $a=$a+1 $s=$g EndFunction
|
Benny69
|
(MM club member)
|
2006-09-22 06:47 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
633 Code:
Function s($z) Dim $a,$b,$c,$d,$e,$f,$g,$h,$i $b=' ' $d=$z For $c=$z to 1 step -1 $b='W'+$b+'B' $d=''+$c+' '+$d+' '+$c+'' $h=$h+'2 ' Next $d=Split($d) For $a=$z-1 to 0 step -1 $h='1 '+$h+'1 ' For $f = 1 to $a $h='2 '+$h+'2 ' Next Next $h=Split(Trim($h)) For Each $c in $d For $f = 1 to $c $e=IIf($a mod 2,'B','W') $g=$g+$e+$h[$i]+' ' $i=$i+1 Next $a=$a+1 Next $d=Split(Trim($g)) ReDim $g[$z*($z+2)] $g[0]=$b $a=1 For Each $c in $d $f=Split($b)[0] $h=Split($b)[1] $e=Right($c,1) $b=IIf(Left($c,1)='W', IIf($e=1,SubStr($f,1,Len($f)-1)+' W',SubStr($f,1,Len($f)-2)+ ' '+Right($f,1)+'W')+$h,$f+ IIf($e=1,'B '+SubStr($h,2,Len($h)-1),'B'+Left($h,1) +' '+SubStr($h,3,Len($h)-2))) $g[$a]=$b $a=$a+1 ;Next $s=$g EndFunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-22 06:48 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
lol.
|
Benny69
|
(MM club member)
|
2006-09-22 06:50 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
booger, you snuck that in
|
Benny69
|
(MM club member)
|
2006-09-22 06:52 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
584 ;p Code:
Function s($z) Dim $a,$b,$c,$d,$e,$f,$g,$h,$i ReDim $s[$z*($z+2)] $b=' ' $d=$z For $c=$z to 1 step -1 $b='W'+$b+'B' $d=''+$c+' '+$d+' '+$c+'' $h=$h+'2 ' Next $d=Split($d) For $a=$z-1 to 0 step -1 $h='1 '+$h+'1 ' For $f = 1 to $a $h='2 '+$h+'2 ' Next Next $h=Split(Trim($h)) For Each $c in $d For $z = 1 to $c $e=IIf($a mod 2,'B','W') $g=$g+$e+$h[$i]+' ' $i=$i+1 Next $a=$a+1 Next $d=Split(Trim($g)) $s[0]=$b $a=1 For Each $c in $d $h=Split($b) $f=$h[0] $h=$h[1] $e=Right($c,1) $b=IIf(Left($c,1)='W', IIf($e=1,Left($f,-1)+' W',Left($f,-2)+ ' '+Right($f,1)+'W')+$h,$f+ IIf($e=1,'B '+Right($h,-1),'B'+Left($h,1) +' '+Right($h,-2))) $s[$a]=$b $a=$a+1 EndFunction
|
Lonkero
|
(KiX Master Guru)
|
2006-09-22 06:59 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
579 Code:
Function s($z) Dim $a,$b,$c,$d,$e,$f,$g,$h,$i ReDim $s[$z*($z+2)] $b=' ' $d=$z For $c=$z to 1 step -1 $b='W'+$b+'B' $d=''+$c+' '+$d+' '+$c+'' $h=$h+'2 ' Next $d=Split($d) For $a=$z-1 to 0 step -1 $h='1 '+$h+'1 ' For $f = 1 to $a $h='2 '+$h+'2 ' Next Next $h=Split(Trim($h)) For Each $c in $d For $z = 1 to $c $g=$g+IIf($a mod 2,'B','W')+$h[$i]+' ' $i=$i+1 Next $a=$a+1 Next $d=Split(Trim($g)) $s[0]=$b $a=1 For Each $c in $d $h=Split($b) $f=$h[0] $h=$h[1] $e=Right($c,1) $b=IIf(Left($c,1)='W', IIf($e=1,Left($f,-1)+' W',Left($f,-2)+ ' '+Right($f,1)+'W')+$h,$f+ IIf($e=1,'B '+Right($h,-1),'B'+Left($h,1) +' '+Right($h,-2))) $s[$a]=$b $a=$a+1 EndFunction
|
Benny69
|
(MM club member)
|
2006-09-22 07:05 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
nice!
|
Benny69
|
(MM club member)
|
2006-09-22 07:16 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
575 Code:
Function s($z) Dim $a,$b,$c,$d,$e,$f,$g,$h,$i ReDim $s[$z*($z+2)] $b=' ' $d=$z For $c=$z to 1 step -1 $b='W'+$b+'B' $d=''+$c+' '+$d+' '+$c+'' $h=$h+'2 ' Next $d=Split($d) $s[0]=$b For $e=$z-1 to 0 step -1 $h='1 '+$h+'1 ' For $f = 1 to $e $h='2 '+$h+'2 ' Next Next $h=Split(Trim($h)) For Each $c in $d For $z = 1 to $c $g=$g+IIf($e mod 2,'B','W')+$h[$i]+' ' $i=$i+1 Next $e=$e+1 Next $d=Split(Trim($g)) For Each $c in $d $a=$a+1 $h=Split($b) $f=$h[0] $h=$h[1] $e=Right($c,1) $b=IIf(Left($c,1)='W', IIf($e=1,Left($f,-1)+' W',Left($f,-2)+ ' '+Right($f,1)+'W')+$h,$f+ IIf($e=1,'B '+Right($h,-1),'B'+Left($h,1) +' '+Right($h,-2))) $s[$a]=$b EndFunction
|
Benny69
|
(MM club member)
|
2006-09-22 07:18 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
570 Code:
Function s($z) Dim $a,$b,$c,$d,$e,$f,$g,$h,$i ReDim $s[$z*($z+2)] $b=' ' $d=$z For $c=$z to 1 step -1 $b='W'+$b+'B' $d=''+$c+' '+$d+' '+$c+'' $h=$h+'2 ' Next $d=Split($d) $s[0]=$b For $e=$z-1 to 0 step -1 $h='1 '+$h+'1 ' For $f = 1 to $e $h='2 '+$h+'2 ' Next Next $h=Split(Trim($h)) For Each $c in $d For $z = 1 to $c $g=$g+IIf($e mod 2,'B','W')+$h[$i]+' ' $i=$i+1 Next $e=$e+1 Next For Each $c in Split(Trim($g)) $a=$a+1 $h=Split($b) $f=$h[0] $h=$h[1] $e=Right($c,1) $b=IIf(Left($c,1)='W', IIf($e=1,Left($f,-1)+' W',Left($f,-2)+ ' '+Right($f,1)+'W')+$h,$f+ IIf($e=1,'B '+Right($h,-1),'B'+Left($h,1) +' '+Right($h,-2))) $s[$a]=$b EndFunction
|
Benny69
|
(MM club member)
|
2006-09-22 07:19 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
565 Code:
Function s($z) Dim $a,$b,$c,$d,$e,$f,$g,$h,$i ReDim $s[$z*($z+2)] $b=' ' $d=$z For $c=$z to 1 step -1 $b='W'+$b+'B' $d=''+$c+' '+$d+' '+$c+'' $h=$h+'2 ' Next $d=Split($d) $s[0]=$b For $e=$z-1 to 0 step -1 $h='1 '+$h+'1 ' For $f = 1 to $e $h='2 '+$h+'2 ' Next Next For Each $c in $d For $z = 1 to $c $g=$g+IIf($e mod 2,'B','W')+Split(Trim($h))[$i]+' ' $i=$i+1 Next $e=$e+1 Next For Each $c in Split(Trim($g)) $a=$a+1 $h=Split($b) $f=$h[0] $h=$h[1] $e=Right($c,1) $b=IIf(Left($c,1)='W', IIf($e=1,Left($f,-1)+' W',Left($f,-2)+ ' '+Right($f,1)+'W')+$h,$f+ IIf($e=1,'B '+Right($h,-1),'B'+Left($h,1) +' '+Right($h,-2))) $s[$a]=$b EndFunction
|
Benny69
|
(MM club member)
|
2006-09-22 07:20 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
560 Code:
Function s($z) Dim $a,$b,$c,$d,$e,$f,$g,$h,$i ReDim $s[$z*($z+2)] $b=' ' $d=$z For $c=$z to 1 step -1 $b='W'+$b+'B' $d=''+$c+' '+$d+' '+$c+'' $h=$h+'2 ' Next $s[0]=$b For $e=$z-1 to 0 step -1 $h='1 '+$h+'1 ' For $f = 1 to $e $h='2 '+$h+'2 ' Next Next For Each $c in Split($d) For $z = 1 to $c $g=$g+IIf($e mod 2,'B','W')+Split(Trim($h))[$i]+' ' $i=$i+1 Next $e=$e+1 Next For Each $c in Split(Trim($g)) $a=$a+1 $h=Split($b) $f=$h[0] $h=$h[1] $e=Right($c,1) $b=IIf(Left($c,1)='W', IIf($e=1,Left($f,-1)+' W',Left($f,-2)+ ' '+Right($f,1)+'W')+$h,$f+ IIf($e=1,'B '+Right($h,-1),'B'+Left($h,1) +' '+Right($h,-2))) $s[$a]=$b EndFunction
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
The public round is now closed. I will post the final results later today.
Thanks to all participants and lurkers.
|
Lonkero
|
(KiX Master Guru)
|
2006-09-23 10:27 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
benny, your code had at least 1 loose var. sadly we never got to golf that part...
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Final results: Public round: Code:
1 Jooel .......... 210 (5 points) 2 RemcovC ........ 213 (4 points) 3 DrillSergeant .. 240 (3 points) 4 Maciep ......... 249 (2 points) 5 benny69 ........ 345 (1 point) 6 Jochen ......... 402 7 Witto .......... 430
Shuttle Puzzle (private+public): Code:
1 Jooel .......... 11 points 2 RemcovC ........ 10 points 3 Maciep ......... 9 points 4 DrillSergeant .. 7 points 5 Benny69 ........ 4 points 6 Jochen ......... 1 points 7 Witto .......... 1 points
KiXgolf 2006 Tournament standings Code:
1 Jooel ............ 22 points 2 DrillSergeant .... 15 points 3 Maciep ........... 14 points 4 Shawn ............ 12 points 5 RemcovC .......... 10 points 6 Benny69 .......... 7 points 7 Richard H ........ 3 points 8 Jochen ........... 2 points 9 Allen ............ 1 point 9 Glenn Barnas ..... 1 point 9 Howard Bullock ... 1 point 9 It_took_my_meds .. 1 point 9 Krabourn ......... 1 point 9 Witto ............ 1 point
|
Jochen
|
(KiX Supporter)
|
2006-09-24 02:28 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Whoa Jens,
what is this point you gave me for?
Quote:
Public round: Code: --------------------------------------------------------------------------------
1 Jooel .......... 210 (5 points) 2 RemcovC ........ 213 (4 points) 3 DrillSergeant .. 240 (3 points) 4 Maciep ......... 249 (2 points) 5 benny69 ........ 345 (1 point) 6 Jochen ......... 402 7 Witto .......... 430
not for public as far as I can see, and I missed to post score for private round by an hour or so... Not to be nitpicking, but playing fair is essential
|
Lonkero
|
(KiX Master Guru)
|
2006-09-24 02:50 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
jochen, participation point.
|
Jochen
|
(KiX Supporter)
|
2006-09-24 03:42 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
Ah ok, forgot about that, sorry .
Right. Thanx for this excellent round Jens. Allthough I haven't had the time I wish I could spent, it was fun! Looking forward to the next one
|
Lonkero
|
(KiX Master Guru)
|
2006-09-24 04:28 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
and next round we most likely will have the upgraded rules and new kixgolf scoring engine.
|
RemcovC
|
(Starting to like KiXtart)
|
2006-09-25 01:56 PM
|
|
|
|
|
Re: KiXgolf: Shuttle Puzzle - Public Round
|
|
I just wanna say this:
I really enjoyed this, hope next round is very soon, and that i have more time to participate (in public round).
Special Thanx to Jens for organizing this
|