#167838 - 2006-09-16 01:05 PM
KiXgolf: Shuttle Puzzle - Public Round
|
Sealeopard
KiX Master
![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif)
Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
|
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 ![](/ubbthreads/images/graemlins/grin.gif)
Let the games (second part) begin...
Edited by sealeopard (2006-09-16 02:17 PM)
_________________________
There are two types of vessels, submarines and targets.
|
Top
|
|
|
|
#167840 - 2006-09-16 01:30 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
maciep
Korg Regular
![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif)
Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
|
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!
|
Top
|
|
|
|
#167841 - 2006-09-16 01:31 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Lonkero
KiX Master Guru
![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif)
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
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
|
Top
|
|
|
|
#167842 - 2006-09-16 01:37 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Lonkero
KiX Master Guru
![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif)
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
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
|
Top
|
|
|
|
#167843 - 2006-09-16 01:39 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Lonkero
KiX Master Guru
![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif)
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
[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
Edited by Jooel (2006-09-16 02:47 PM)
|
Top
|
|
|
|
#167846 - 2006-09-16 01:46 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Lonkero
KiX Master Guru
![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif)
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
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.
|
Top
|
|
|
|
#167847 - 2006-09-16 01:48 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
maciep
Korg Regular
![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif)
Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
|
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
|
Top
|
|
|
|
#167849 - 2006-09-16 01:54 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Lonkero
KiX Master Guru
![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif)
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
damn... my bad. damn. should have checked right away. had commented out the valid lines when wanted to quickly test possible shorter resolutions ![](/ubbthreads/images/graemlins/mad.gif)
so, your code indeed worked fine. sorry.
|
Top
|
|
|
|
#167850 - 2006-09-16 01:55 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
maciep
Korg Regular
![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif)
Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
|
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
Edited by maciep (2006-09-16 02:26 PM)
|
Top
|
|
|
|
#167851 - 2006-09-16 01:57 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Lonkero
KiX Master Guru
![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif)
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
don't see no pattern in your pasted list ![](/ubbthreads/images/graemlins/frown.gif)
care to bold the key???
|
Top
|
|
|
|
#167853 - 2006-09-16 02:05 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Jochen
KiX Supporter
![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif)
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
Top
|
|
|
|
#167854 - 2006-09-16 02:16 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
RemcovC
Starting to like KiXtart
![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif)
Registered: 2006-09-13
Posts: 174
Loc: Holland
|
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
|
Top
|
|
|
|
#167855 - 2006-09-16 02:17 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
RemcovC
Starting to like KiXtart
![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif)
Registered: 2006-09-13
Posts: 174
Loc: Holland
|
Lol im no stranger anymore.... im newbie now
|
Top
|
|
|
|
#167856 - 2006-09-16 02:20 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Jochen
KiX Supporter
![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif)
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 947 anonymous users online.
|
|
|