Page 3 of 5 <12345>
Topic Options
#149304 - 2005-10-06 05:48 PM Re: KiXgolf: Fragmentation - Public Coding
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
or just change the order around until it fails.
Top
#149305 - 2005-10-06 07:13 PM Re: KiXgolf: Fragmentation - Public Coding
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
and the last correctly working code is?
_________________________
!

download KiXnet

Top
#149306 - 2005-10-06 07:15 PM Re: KiXgolf: Fragmentation - Public Coding
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
I believe it is the brand new solution i came up with

Quote:


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
#149307 - 2005-10-06 07:29 PM Re: KiXgolf: Fragmentation - Public Coding
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, lets take some vodka and think.
I added the modified test 54 as test54b to my ini.
_________________________
!

download KiXnet

Top
#149308 - 2005-10-06 07:31 PM 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.ki

Computer
OS = Windows 2000 Professiona
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 20:07:45.772
Processing End = 2005/10/06 20:10:12.022
Duration = 0000/00/00 00:02:26.250
Used Processor Time = 00:02:14.573
# Tests Run = 181
# Tests Passed = 181
# Tests Failed = 0
Result = passed
KiXGolf Score = 215

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


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= ($x[$i] | $x[$j] | $f<>$[$j]+$[$i] | $i=$j)
$c=$c+2
$x[$i]=1
$x[$j]=1
if $c>$u
exit
endfunction

_________________________
!

download KiXnet

Top
#149309 - 2005-10-07 12:02 AM Re: KiXgolf: Fragmentation - Public Coding
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
as nobody else wants to cut the scores, I guess I have to for the rest of us...

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/07 00:37:52.626
Processing End = 2005/10/07 00:40:11.255
Duration = 0000/00/00 00:02:18.629
Used Processor Time = 00:02:05.931
# Tests Run = 181
# Tests Passed = 181
# Tests Failed = 0
Result = passed
KiXGolf Score = 213

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


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 1 ^ $x[$i] | $x[$j] | $f<>$[$j]+$[$i] | $i=$j
$c=$c+2
$x[$i]=1
$x[$j]=1
if $c>$u
exit
endfunction

_________________________
!

download KiXnet

Top
#149310 - 2005-10-07 04:27 AM Re: KiXgolf: Fragmentation - Public Coding
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
heh, I forgot this last cheat.
was playing with it at the time of the previous tournament but never found a place for it.
well, now I did.
behold, my new shortest code:
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/07 04:37:01.429
Processing End = 2005/10/07 04:39:05.817
Duration = 0000/00/00 00:02:04.387
Used Processor Time = 00:02:00.823
# Tests Run = 181
# Tests Passed = 181
# Tests Failed = 0
Result = passed
KiXGolf Score = 212

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


Code:
Function f($)
dim $u,$i,$j
$u=ubound($)
while 1
dim $x[$u],$c
$f=''
for $j=1 to 2*(0^join($,''))/($u+1)
$f=$f+rnd(1)
next
for $j=0 to $u
for $i=0 to $u
if 1 ^ $x[$i] | $x[$j] | $i=$j | $f<>$[$j]+$[$i]
$c=$c+2
$x[$i]=1
$x[$j]=1
if $c>$u
exit
endfunction

_________________________
!

download KiXnet

Top
#149311 - 2005-10-07 05:41 AM Re: KiXgolf: Fragmentation - Public Coding
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
just to keep the board alive...
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/07 06:17:53.611
Processing End = 2005/10/07 06:19:52.552
Duration = 0000/00/00 00:01:58.940
Used Processor Time = 00:01:55.766
# Tests Run = 181
# Tests Passed = 181
# Tests Failed = 0
Result = passed
KiXGolf Score = 210


Code:
Function f($u)
dim $,$i,$j
$j=ubound($u)
while 1
dim $x[$j],$c
$f=''
for $=1 to 2*(0^join($u,''))/($j+1)
$f=$f+rnd(1)
next
for $=0 to $j
for $i=0 to $j
if 1 ^ $x[$i] | $x[$] | $i=$ | $f<>$u[$]+$u[$i]
$c=$c+2
$x[$i]=1
$x[$]=1
if $c>$j
exit
endfunction

_________________________
!

download KiXnet

Top
#149312 - 2005-10-07 05:57 AM Re: KiXgolf: Fragmentation - Public Coding
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
heading to bed, so must post my current score:
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/07 06:33:41.254
Processing End = 2005/10/07 06:35:37.050
Duration = 0000/00/00 00:01:55.795
Used Processor Time = 00:01:48.095
# Tests Run = 181
# Tests Passed = 181
# Tests Failed = 0
Result = passed
KiXGolf Score = 207

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


Code:

Function f($u)
dim $,$i,$j,$c
$j=ubound($u)
while $c<$j
dim $x[$j]
$f='' $c=0
for $=1 to 2*(0^join($u,''))/($j+1)
$f=$f+rnd(1)
next
for $=0 to $j
for $i=0 to $j
if 1 ^ $x[$i] | $x[$] | $i=$ | $f<>$u[$]+$u[$i]
$c=$c+2
$x[$i]=1
$x[$]=1
Endfunction

_________________________
!

download KiXnet

Top
#149313 - 2005-10-07 01:54 PM Re: KiXgolf: Fragmentation - Public Coding
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
Damn jooel, you golfed the f out of this function. Here's one more stroke...i knew i got a math minor for a reason.

Code:

Function f($u)
dim $,$i,$j,$c
$j=ubound($u)
while $c<$j
dim $x[$j]
$f='' $c=0
for $=1 to 2*(0^join($u,''))
$f=$f+rnd(1)
$=$+$j
next
for $=0 to $j
for $i=0 to $j
if 1 ^ $x[$i] | $x[$] | $i=$ | $f<>$u[$]+$u[$i]
$c=$c+2
$x[$i]=1
$x[$]=1
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/07 07:31:15.755
Processing End = 2005/10/07 07:31:43.052
Duration = 0000/00/00 00:00:27.296
# Tests Run = 180
# Tests Passed = 180
# Tests Failed = 0
Result = passed
KiXGolf Score = 206




Top
#149314 - 2005-10-07 03:10 PM Re: KiXgolf: Fragmentation - Public Coding
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
337:

Code:

Function F($)

Dim $m,$i,$j,$g,$k,$l,$u,$v,$a,$s,$p
$m=ubound($)
$l=2*len(join($,''))/($m+1)

for $i=0 to $m
for $j=0 to $m

$p=$[$i]+$[$j]

if len($p) = $l
$s=$s+','+$p
$a=split(substr($s,2),',')

$u=0
for $k=0 to ubound($a)
if ascan($a,$p,$k,1) >=0
$u=1+$u
endif
next

if $v <= $u
$v=$u
$g=1
for $k=0 to $m
if not instr($p,$[$k])
$g=0
endif
next
if $g
$f=$p
endif
endif

endif

next
next

EndFunction

_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#149315 - 2005-10-07 11:38 PM Re: KiXgolf: Fragmentation - Public Coding
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
fine...
I didn't even enter the college dude, but I ain't a quitter:
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/08 00:14:23.707
Processing End = 2005/10/08 00:16:25.853
Duration = 0000/00/00 00:02:02.146
Used Processor Time = 00:01:49.166
# Tests Run = 181
# Tests Passed = 181
# Tests Failed = 0
Result = passed
KiXGolf Score = 204

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


Code:
Function f($u)
dim $,$i,$j,$c
$j=ubound($u)
while $c<$j
dim $x[$j]
$f='' $c=0
for $=1 to 0^join($u,'')
$f=$f+rnd(1)
$=$+$j/2
next
for $=0 to $j
for $i=0 to $j
if 1 ^ $x[$i] | $x[$] | $i=$ | $f<>$u[$]+$u[$i]
$c=$c+2
$x[$i]=1
$x[$]=1
Endfunction

_________________________
!

download KiXnet

Top
#149316 - 2005-10-08 12:07 AM Re: KiXgolf: Fragmentation - Public Coding
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
When you going to break the 200 barrier Jooel?
Top
#149317 - 2005-10-08 12:09 AM Re: KiXgolf: Fragmentation - Public Coding
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I quess that happens when maciep forces my hand

anyways, he can be the one doing the honors... who knows.
_________________________
!

download KiXnet

Top
#149318 - 2005-10-08 12:10 AM Re: KiXgolf: Fragmentation - Public Coding
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
and btw, thanks for the code pat.
_________________________
!

download KiXnet

Top
#149319 - 2005-10-08 12:41 AM Re: KiXgolf: Fragmentation - Public Coding
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
nice catch jooel. I'm not seeing much else left in there to cut out, but who knows. If you stare long enough...

Btw, i award you an honorary minor in math

Top
#149320 - 2005-10-08 12:46 AM Re: KiXgolf: Fragmentation - Public Coding
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
heh, thanks but that math score won't get me any glory outside this board.
thanks anyways.

I already made a script working differently but it only got me to 204 so...
still working on it.
_________________________
!

download KiXnet

Top
#149321 - 2005-10-08 12:49 AM Re: KiXgolf: Fragmentation - Public Coding
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
Howabout a explaination as to how the hell all that works... especially

Quote:

if 1 ^ $x[$i] | $x[$] | $i=$ | $f<>$u[$]+$u[$i]




Top
#149322 - 2005-10-08 12:54 AM Re: KiXgolf: Fragmentation - Public Coding
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
maciep can go about it, I'm busy.

basically, it's the operand precedence.
the lately added ^ has the lowest precedence there is.
so everything is calculated before it.
then 1 ^ makes it so, only 0 is accepted.

well...
it's pretty simple. you just need to stare it long enough.
_________________________
!

download KiXnet

Top
#149323 - 2005-10-08 12:56 AM Re: KiXgolf: Fragmentation - Public Coding
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, if someone else is working on the kixgolf tester, let me know.
I just added a kixformsVer() system into it.
_________________________
!

download KiXnet

Top
Page 3 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 700 anonymous users online.
Newest Members
Timothy, Jojo67, MaikSimon, kvn317, kixtarts2025
17874 Registered Users

Generated in 0.206 seconds in which 0.172 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