Page 1 of 8 12345>Last »
Topic Options
#167838 - 2006-09-16 01:05 PM KiXgolf: Shuttle Puzzle - Public Round
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
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

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
#167839 - 2006-09-16 01:21 PM Re: KiXgolf: Shuttle Puzzle - Public Round
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
that link doesn't work jens...
Top
#167840 - 2006-09-16 01:30 PM Re: KiXgolf: Shuttle Puzzle - Public Round
maciep Offline
Korg Regular
*****

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 Administrator Offline
KiX Master Guru
*****

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 Administrator Offline
KiX Master Guru
*****

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 Administrator Offline
KiX Master Guru
*****

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
#167844 - 2006-09-16 01:41 PM Re: KiXgolf: Shuttle Puzzle - Public Round
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
It works fine on 4.51. Can't believe i never removed those quotes!
Top
#167845 - 2006-09-16 01:42 PM Re: KiXgolf: Shuttle Puzzle - Public Round
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
tested with 4.51 (the version you used) and it failed as well.
Top
#167846 - 2006-09-16 01:46 PM Re: KiXgolf: Shuttle Puzzle - Public Round
Lonkero Administrator Offline
KiX Master Guru
*****

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 Offline
Korg Regular
*****

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
#167848 - 2006-09-16 01:50 PM Re: KiXgolf: Shuttle Puzzle - Public Round
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
What tester were you using?
Top
#167849 - 2006-09-16 01:54 PM Re: KiXgolf: Shuttle Puzzle - Public Round
Lonkero Administrator Offline
KiX Master Guru
*****

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

so, your code indeed worked fine.
sorry.

Top
#167850 - 2006-09-16 01:55 PM Re: KiXgolf: Shuttle Puzzle - Public Round
maciep Offline
Korg Regular
*****

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 Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
don't see no pattern in your pasted list

care to bold the key???

Top
#167852 - 2006-09-16 02:00 PM Re: KiXgolf: Shuttle Puzzle - Public Round
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
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.

Top
#167853 - 2006-09-16 02:05 PM Re: KiXgolf: Shuttle Puzzle - Public Round
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
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)


Edited by Jochen (2006-09-16 02:09 PM)
_________________________



Top
#167854 - 2006-09-16 02:16 PM Re: KiXgolf: Shuttle Puzzle - Public Round
RemcovC Offline
Starting to like KiXtart
*****

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 Offline
Starting to like KiXtart
*****

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 Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Congrats Remco!!! I predict the status to change soon

So, I now go back silently crying in my pillow
_________________________



Top
#167857 - 2006-09-16 02:21 PM Re: KiXgolf: Shuttle Puzzle - Public Round
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
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
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 8 12345>Last »


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 382 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.055 seconds in which 0.019 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org