Page 2 of 5 <12345>
Topic Options
#149284 - 2005-10-06 02:47 AM Re: KiXgolf: Fragmentation - Public Coding
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
Funny, you decided not to keep track but make sure the length was right. I decide that i didn't care what the length was but would just keep track.

I heart kix golf.

Top
#149285 - 2005-10-06 03:01 AM Re: KiXgolf: Fragmentation - Public Coding
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
More with Allen's code

Code:

function f($)
dim $h,$c,$o,$t,$a
$f=ubound($)
for $c=0 to $f
for $h=$c+1 to $f
$a=$[$c]+$[$h]
if len($a)=2*len(join($,""))/($f+1)
$o=$o + a +$a+ a+ $[$h]+$[$c]
endif
next
next
for each $ in split($o,a)
$h=ubound(split($o,$))
if $h>$t
$t=$h
$f=$
;endif
;next
endfunction



Quote:


KiXtart Engine
KiXtart Version = 4.50
KiXGolf Script = kixgolf_fragmentation.kix

Computer
OS = Windows XP Professional
CPU = Intel(R) Xeon(TM)
Speed = 2790 MHz
Memory = 1024 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXGolf Score
Tournament = Fragmentation
Processing Start = 2005/10/05 20:40:41.411
Processing End = 2005/10/05 20:40:41.661
Duration = 0000/00/00 00:00:00.250
# Tests Run = 180
# Tests Passed = 180
# Tests Failed = 0
Result = passed
KiXGolf Score = 221




Top
#149286 - 2005-10-06 03:07 AM Re: KiXgolf: Fragmentation - Public Coding
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
Yeah Baby!
Top
#149287 - 2005-10-06 03:36 AM Re: KiXgolf: Fragmentation - Public Coding
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
fine.
220:
Code:

function f($)
dim $h,$c,$o,$t
$f=ubound($)
for $c=0 to $f
for $h=$c+1 to $f
$t = a+$[$c]+$[$h]+a
if len($t)=2+2*len(join($,""))/($f+1)
$o=$o+$t+$[$h]+$[$c]
endif
next
next
for each $ in split($o,a)
$h=ubound(split($o,$))
if $h>$t
$t=$h
$f=$
;endif
;next
endfunction

_________________________
!

download KiXnet

Top
#149288 - 2005-10-06 03:53 AM Re: KiXgolf: Fragmentation - Public Coding
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
Code:

KiXtart Engine
KiXtart Version = 4.50 (WKIX32.EXE)
KiXGolf Script = kixgolf_fragmentation.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 797 MHz
Memory = 376 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXGolf Score
Tournament = Fragmentation
Processing Start = 2005/10/06 04:31:15.674
Processing End = 2005/10/06 04:31:17.717
Duration = 0000/00/00 00:00:02.042
Used Processor Time = 00:00:00.981
# Tests Run = 180
# Tests Passed = 180
# Tests Failed = 0
Result = passed
KiXGolf Score = 218

Thank you for participating in KiXtart Golf!
Press any key to continue...


Code:

function f($)
dim $h,$c,$o,$t
$f=ubound($)
for $c=0 to $f
for $h=$c+1 to $f
$t = a+$[$c]+$[$h]+aa
if len($t)=2+2*len(join($))/($f+1)
$o=$o+$t+$[$h]+$[$c]
endif
next
next
for each $ in split($o,a)
$h=ubound(split($o,$))
if $h>$t
$t=$h
$f=$
endfunction

_________________________
!

download KiXnet

Top
#149289 - 2005-10-06 03:55 AM Re: KiXgolf: Fragmentation - Public Coding
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
217
Code:

function f($)
dim $h,$c,$o,$t
$f=ubound($)
for $c=0 to $f
for $h=$c+1 to $f
$t = a+$[$c]+$[$h]+a
if len($t)=1+2*len(join($))/($f+1)
$o=$o+$t+$[$h]+$[$c]
endif
next
next
for each $ in split($o,a)
$h=ubound(split($o,$))
if $h>$t
$t=$h
$f=$
endfunction

_________________________
!

download KiXnet

Top
#149290 - 2005-10-06 03:57 AM Re: KiXgolf: Fragmentation - Public Coding
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK

Code:


KiXtart Engine
KiXtart Version = 4.50 (WKIX32.EXE)
KiXGolf Script = kixgolf_fragmentation.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 797 MHz
Memory = 376 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXGolf Score
Tournament = Fragmentation
Processing Start = 2005/10/06 04:35:57.640
Processing End = 2005/10/06 04:36:01.415
Duration = 0000/00/00 00:00:03.775
Used Processor Time = 00:00:01.111
# Tests Run = 180
# Tests Passed = 180
# Tests Failed = 0
Result = passed
KiXGolf Score = 215

Thank you for participating in KiXtart Golf!

Code:
 function f($)
dim $h,$c,$o,$t
$f=ubound($)
for $c=0 to $f
for $h=$c+1 to $f
$t = a+$[$c]+$[$h]
if len($t)=2*len(join($))/($f+1)
$o=$o+$t+a+$[$h]+$[$c]
endif
next
next
for each $ in split($o,a)
$h=ubound(split($o,$))
if $h>$t
$t=$h
$f=$
endfunction

_________________________
!

download KiXnet

Top
#149291 - 2005-10-06 04:05 AM Re: KiXgolf: Fragmentation - Public Coding
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
Geezus... That's amazing!
Top
#149292 - 2005-10-06 06:08 AM Re: KiXgolf: Fragmentation - Public Coding
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
Here's another apporach using rnd() that just came to me. Golf away....

Code:

Function f($)
dim $u,$i,$j
$u=ubound($)
while 1
dim $x[$u],$c
$f=''
for $j=1 to 2*len(join($,""))/($u+1)
$f=$f+rnd(1)
next
for $j=0 to $u
for $i=0 to $u
if 0=($i=$j)+ $x[$i] + $x[$j]+ ($[$j]+$[$i]<>$f)
$c=$c+2
$x[$i]=1
$x[$j]=1
if $c>$u
exit
;endif
;endif
;next
;next
;loop
endfunction


Quote:


KiXtart Engine
KiXtart Version = 4.50
KiXGolf Script = kixgolf_fragmentation.kix

Computer
OS = Windows XP Professional
CPU = Intel(R) Xeon(TM) CPU 2.80GHz
Speed = 2790 MHz
Memory = 1024 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXGolf Score
Tournament = Fragmentation
Processing Start = 2005/10/05 23:46:34.779
Processing End = 2005/10/05 23:47:04.670
Duration = 0000/00/00 00:00:29.891
# Tests Run = 180
# Tests Passed = 180
# Tests Failed = 0
Result = passed
KiXGolf Score = 217




Top
#149293 - 2005-10-06 06:22 AM Re: KiXgolf: Fragmentation - Public Coding
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Seems you guys are having fun.

I apologize for not having opened the public round. I sent an email to Jooel asking him to open the public round (Shawn should have a copy), which bounced because I had his old email address. My fault. To make a long story short, I was stuck at work in a meeting that went way into the evening, thus sneaked out to send an email via Blackberry :-(

I should be able to provide the private coding winners tomorrow and then we'll see how the public round goes. Interesting that the tricks from the last round are now being adapted and pushed to even more extremes. wonder what Ruud would say about this
_________________________
There are two types of vessels, submarines and targets.

Top
#149294 - 2005-10-06 02:02 PM Re: KiXgolf: Fragmentation - Public Coding
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
By the way, it looks like Allen's code is flawed like my original was. It passes all of the tests, but, for example, if you change test 54 to '0,00,10,1', it breaks. It returns 000 instead of 100. It depends on the order of when combinations are added to $o
Top
#149295 - 2005-10-06 02:50 PM Re: KiXgolf: Fragmentation - Public Coding
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you saying that all of the codes by allen are flawed?
hmm...
that makes me a leader again with your code

Jens, nice to hear you didn't forget us.
and no worries, we did manage on our own too.
_________________________
!

download KiXnet

Top
#149296 - 2005-10-06 02:58 PM Re: KiXgolf: Fragmentation - Public Coding
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
actually, i think i'm the leader with the new code i posted...or maybe i missed something.

And here is the code that 'found' Allen's flaw. Logically, it should work the same as his original, but it fails.

Code:

function f($)
dim $h,$c,$o,$t
$f=ubound($)
for $c=0 to $f
for $h=0 to $f
$t = a+$[$c]+$[$h]
if len($t)=2*len(join($))/($f+1) and $h<>$c
$o=$o+$t
endif
next
next
for each $ in split($o,a)
$h=ubound(split($o,$))
if $h>$t
$t=$h
$f=$
endfunction


Top
#149297 - 2005-10-06 03:39 PM Re: KiXgolf: Fragmentation - Public Coding
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you saying this fails or the original?
what is the test of yours?
I will add it to my tests and get it over with...
_________________________
!

download KiXnet

Top
#149298 - 2005-10-06 03:45 PM Re: KiXgolf: Fragmentation - Public Coding
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
Possible solutions:
000 000 010 100 001 100 101 110

Which you are correct 000 would show up first. But in this case how would you know which is right since they both are just as likely to be the correct answer, and there are no duplicates?

Top
#149299 - 2005-10-06 03:48 PM Re: KiXgolf: Fragmentation - Public Coding
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
the introduction said, there is no possible duplicates.
that is, each test has only 1 match.

if this line works with 2, then it's not cool.
if only one, it can be calculated.
_________________________
!

download KiXnet

Top
#149300 - 2005-10-06 03:51 PM Re: KiXgolf: Fragmentation - Public Coding
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
So that means the that test is invalid, right?
Top
#149301 - 2005-10-06 03:54 PM Re: KiXgolf: Fragmentation - Public Coding
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
By duplicates, I meant from the input array.
Top
#149302 - 2005-10-06 03:58 PM Re: KiXgolf: Fragmentation - Public Coding
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
The test case is valid. you cannot 0 to 00 and then add 00 to 0 and consider those as different combinations. Yeah, you have two, but they're the same so it's really one. Allen's code sees them as two diff combinations though.
Top
#149303 - 2005-10-06 04:02 PM Re: KiXgolf: Fragmentation - Public Coding
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
ah that sucks... ...

So now I need to figure out why it passed test two when I change the order around.

Top
Page 2 of 5 <12345>


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

Who's Online
0 registered and 420 anonymous users online.
Newest Members
Raoul, Timothy, Jojo67, MaikSimon, kvn317
17875 Registered Users

Generated in 0.145 seconds in which 0.092 seconds were spent on a total of 13 queries. Zlib compression enabled.

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