Page 3 of 8 <12345>Last »
Topic Options
#167878 - 2006-09-16 10:23 PM Re: KiXgolf: Shuttle Puzzle - Public Round
Lonkero Administrator Offline
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 Offline
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 Offline
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 Offline
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
#167882 - 2006-09-16 11:17 PM Re: KiXgolf: Shuttle Puzzle - Public Round
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
what you mean extra round?
Top
#167883 - 2006-09-16 11:17 PM Re: KiXgolf: Shuttle Puzzle - Public Round
RemcovC Offline
Starting to like KiXtart
*****

Registered: 2006-09-13
Posts: 174
Loc: Holland
i meant 1 extra loop, you can do it by adding $n to -$c.... but it doesnt do what i hoped it would do
Top
#167884 - 2006-09-16 11:18 PM Re: KiXgolf: Shuttle Puzzle - Public Round
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you got idea for cutting?

I think next task is to combine the for loops...

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

Registered: 2006-09-13
Posts: 174
Loc: Holland
You mean something like in my code, 1 loop ?
Top
#167886 - 2006-09-16 11:25 PM Re: KiXgolf: Shuttle Puzzle - Public Round
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yup.
actually, your code has some potential, but not sure if one could ever shave 65 from it.

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

Registered: 2006-09-13
Posts: 174
Loc: Holland
I was thinking more of trying to get rid of this line:

$ = split($,a)

Top
#167888 - 2006-09-17 12:12 AM Re: KiXgolf: Shuttle Puzzle - Public Round
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
can't really get rid of it without reworking the whole logic.

Top
#167889 - 2006-09-17 12:14 AM Re: KiXgolf: Shuttle Puzzle - Public Round
RemcovC Offline
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 Administrator Offline
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
#167891 - 2006-09-17 01:39 PM Re: KiXgolf: Shuttle Puzzle - Public Round
Sealeopard Offline
KiX Master
*****

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

Top
#167892 - 2006-09-17 01:41 PM Re: KiXgolf: Shuttle Puzzle - Public Round
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
do something?
adding extra stroke to the leading code would come up with 211.
how fair is that?

Top
#167893 - 2006-09-17 02:32 PM Re: KiXgolf: Shuttle Puzzle - Public Round
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Adding a stroke would not get counted, you will have to decrease the count.
_________________________
There are two types of vessels, submarines and targets.

Top
#167894 - 2006-09-17 03:40 PM Re: KiXgolf: Shuttle Puzzle - Public Round
Benny69 Offline
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)
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#167895 - 2006-09-17 04:06 PM Re: KiXgolf: Shuttle Puzzle - Public Round
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
Jochen,
I just noticed that you and I had the same idea. Great minds,...
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#167896 - 2006-09-18 12:26 AM Re: KiXgolf: Shuttle Puzzle - Public Round
Witto Offline
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
#167897 - 2006-09-18 12:36 AM Re: KiXgolf: Shuttle Puzzle - Public Round
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Jochen, can I help shaving your code? It would maybe bring me to the 6th place...
Top
Page 3 of 8 <12345>Last »


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

Who's Online
0 registered and 700 anonymous users online.
Newest Members
Timothy, Jojo67, MaikSimon, kvn317, kixtarts2025
17874 Registered Users

Generated in 0.077 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

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