#167878 - 2006-09-16 10:23 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
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
|
Top
|
|
|
|
#167879 - 2006-09-16 11:06 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
RemcovC
Starting to like KiXtart
Registered: 2006-09-13
Posts: 174
Loc: Holland
|
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
|
Top
|
|
|
|
#167880 - 2006-09-16 11:07 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
RemcovC
Starting to like KiXtart
Registered: 2006-09-13
Posts: 174
Loc: Holland
|
Cool.... my new title
Really like it
|
Top
|
|
|
|
#167881 - 2006-09-16 11:09 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
RemcovC
Starting to like KiXtart
Registered: 2006-09-13
Posts: 174
Loc: Holland
|
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
Edited by RemcovC (2006-09-16 11:17 PM)
|
Top
|
|
|
|
#167889 - 2006-09-17 12:14 AM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
RemcovC
Starting to like KiXtart
Registered: 2006-09-13
Posts: 174
Loc: Holland
|
yeah, came to that conclusion to, think its time to go to bed, maybe tommorow, when im sober again thinking goes smoother
|
Top
|
|
|
|
#167890 - 2006-09-17 11:38 AM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
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
|
Top
|
|
|
|
#167894 - 2006-09-17 03:40 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
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
Edited by benny69 (2006-09-17 04:07 PM)
|
Top
|
|
|
|
#167895 - 2006-09-17 04:06 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
Jochen, I just noticed that you and I had the same idea. Great minds,...
|
Top
|
|
|
|
#167896 - 2006-09-18 12:26 AM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Witto
MM club member
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
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!
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 920 anonymous users online.
|
|
|