#99683 - 2003-03-18 02:34 PM
Re: KiXGolf: CD Sorter, Part II (public)
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
maciep, you're getting closer. A couple more 'Rocks' should do the trick and provide you the free thinking state you need to beat Jooel.
|
Top
|
|
|
|
#99687 - 2003-03-18 05:11 PM
Re: KiXGolf: CD Sorter, Part II (public)
|
maciep
Korg Regular
Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
|
good call Shawn. It slows it down a bit, but this is a golf tournament.
quote:
Average CD Length = 44.26 Average Gap = 0.74 Average Gap [%] = 1.65
KiXtart KiXtart Version = 4.20 Release Candidate 3 KiXGolf Script = kixgolf_cd.kix
Computer OS = Windows XP Professional CPU = Intel Pentium III Speed = 730 MHz Memory = 126 MB
KiXGolf Scoring Engine Scoring Engine = 3.0.3
KiXtart Golf Score Tournament = KiXtart Golf: CD Sorter Processing Start = 2003/03/18 11:15:27.621 Processing End = 2003/03/18 11:15:33.605 Duration = 0000/00/00 00:00:05.984 # Loops = 1 # Processed CDs = 12 # Valid CDs = 12 # Full CDs = 0 KiXGolf Result = Valid CD Filling KiXGolf Score = 169
Thank you for participating in KiXtart Golf!
code:
function CDSorter($a, $b) dim $, $u,$p, $t do $p = -0.5 + $b $u="" $=0 for each $t in split($a, ",") $=1+$ if rnd(2) & $p > $t $p = $p - $t $u = $u+ "," + $ endif next until 0=$p $CDSorter = substr($u,2) endfunction
_________________________
Eric
|
Top
|
|
|
|
#99689 - 2003-03-18 05:13 PM
Re: KiXGolf: CD Sorter, Part II (public)
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Great stuff - good thinking.
code:
Average CD Length = 44.21 Average Gap = 0.79 Average Gap [%] = 1.77
KiXtart KiXtart Version = 4.21 Release Candidate 1 KiXGolf Script = kixgolf_cd.kix
Computer OS = Windows 2000 Professional CPU = Intel Pentium III Speed = 698 MHz Memory = 511 MB
KiXGolf Scoring Engine Scoring Engine = 3.0.3
KiXtart Golf Score Tournament = KiXtart Golf: CD Sorter Processing Start = 2003/03/18 11:16:47.098 Processing End = 2003/03/18 11:17:49.758 Duration = 0000/00/00 00:01:02.660 # Loops = 1 # Processed CDs = 13 # Valid CDs = 13 # Full CDs = 0 KiXGolf Result = Valid CD Filling KiXGolf Score = 163 Thank you for participating in KiXtart Golf!
code:
function CDSorter($a, $b) dim $p do dim $u, $, $t $p = -0.5 + $b for each $t in split($a, ",") $u=1+$u if rnd(2) & $p > $t $p = $p - $t $ = $ + "," + $u endif next $CDSorter = substr($,2) until 0=$p endfunction
|
Top
|
|
|
|
#99690 - 2003-03-18 05:17 PM
Re: KiXGolf: CD Sorter, Part II (public)
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
161
code:
function CDSorter($a, $b) dim $ do dim $u, $q, $t $ = -0.5 + $b for each $t in split($a, ",") $u=1+$u if rnd(2) & $ > $t $ = $ - $t $q = $q + "," + $u endif next $CDSorter = substr($q,2) until 0=$ endfunction
code:
Average CD Length = 44.25 Average Gap = 0.75 Average Gap [%] = 1.68
KiXtart KiXtart Version = 4.21 Release Candidate 1 KiXGolf Script = kixgolf_cd.kix
Computer OS = Windows 2000 Professional CPU = Intel Pentium III Speed = 698 MHz Memory = 511 MB
KiXGolf Scoring Engine Scoring Engine = 3.0.3
KiXtart Golf Score Tournament = KiXtart Golf: CD Sorter Processing Start = 2003/03/18 11:21:57.525 Processing End = 2003/03/18 11:22:04.595 Duration = 0000/00/00 00:00:07.069 # Loops = 1 # Processed CDs = 13 # Valid CDs = 13 # Full CDs = 0 KiXGolf Result = Valid CD Filling KiXGolf Score = 161 Thank you for participating in KiXtart Golf!
|
Top
|
|
|
|
#99691 - 2003-03-18 05:21 PM
Re: KiXGolf: CD Sorter, Part II (public)
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
maciep, great logic! Haven't fully digested it yet. Too busy reducing your code.
You are welcome to ALL KixGolf sessions. If you had come up with this before Saturday, I would have thown in the the Towel.
Check out the little tricks used to shave strokes. They will be handy on your next outing.
Outstanding effort!. How did you come to think of this methodolgy? [ 18. March 2003, 17:22: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#99692 - 2003-03-18 05:27 PM
Re: KiXGolf: CD Sorter, Part II (public)
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Oops! The "-0.5" bit you just like Jooel. Songs of 1.0000 length cause the script to enter an infinite loop.
Don't think that should count on any of the code samples though since the code does pass the Jens test suite. That was the goal after all. But if Jens thinks it should add a couple stroke? [ 18. March 2003, 17:27: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#99694 - 2003-03-18 05:40 PM
Re: KiXGolf: CD Sorter, Part II (public)
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
You must have a sloowww computer.
Just ran again. This code is a little slower than the others.
|
Top
|
|
|
|
#99698 - 2003-03-18 06:28 PM
Re: KiXGolf: CD Sorter, Part II (public)
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
154 ???
code:
function CDSorter($a, $) do dim $u, $q, $t $ = 0.5 + $ for each $t in split($a, ",") $u=1+$u if rnd(2) & $ > $t $ = $ - $t $q = $q + "," + $u endif next $CDSorter = substr($q,2) until 1=$ endfunction
|
Top
|
|
|
|
#99699 - 2003-03-18 07:07 PM
Re: KiXGolf: CD Sorter, Part II (public)
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Shawn, that does not work, sorry. You have lost the original value of "$" and as a result causes problems.
KiXtart KiXtart Version = 4.21 Release Candidate 1 KiXGolf Script = kixgolf_cd.kix
Computer OS = Windows 2000 Professional CPU = Intel Pentium III Speed = 698 MHz Memory = 511 MB
KiXGolf Scoring Engine Scoring Engine = 3.0.3
KiXtart Golf Score Tournament = KiXtart Golf: CD Sorter Processing Start = 2003/03/18 13:10:25.863 Processing End = 2003/03/18 13:10:37.079 Duration = 0000/00/00 00:00:11.216 # Loops = 1 # Processed CDs = 13 # Valid CDs = 1 # Full CDs = 0 KiXGolf Result = Invalid CD Filling KiXGolf Score = 154 Thank you for participating in KiXtart Golf!
|
Top
|
|
|
|
#99700 - 2003-03-18 07:10 PM
Re: KiXGolf: CD Sorter, Part II (public)
|
maciep
Korg Regular
Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
|
Howard,
I just ran CD13 against the function using "and" instead of "&" and it passed.
quote:
CD #13 Title = Lonkero's Test Song #s = 1,2,3,5,6,7,8,9,10,12,13,15,16,17,18,19,20,21,22,23,24,26,27,28,29,30,31,32,33,34 ,35,36,37,38,39,40,41,42,43,44,45,46,47,49 CD Length = 44.0000 CD Gap = 1.0000 CD Gap [%] = 2.2222 Req. CD Length = 44.0000 Result = CD has been filled Processing Start = 2003/03/18 13:14:21.820 Processing End = 2003/03/18 13:14:23.179 Duration = 0000/00/00 00:00:01.358
Average CD Length = 44.30 Average Gap = 0.70 Average Gap [%] = 1.56
KiXtart KiXtart Version = 4.20 Release Candidate 3 KiXGolf Script = kixgolf_cd.kix
Computer OS = Windows XP Professional CPU = Intel Pentium III Speed = 730 MHz Memory = 126 MB
KiXGolf Scoring Engine Scoring Engine = 3.0.3
KiXtart Golf Score Tournament = KiXtart Golf: CD Sorter Processing Start = 2003/03/18 13:14:21.679 Processing End = 2003/03/18 13:14:23.179 Duration = 0000/00/00 00:00:01.500 # Loops = 1 # Processed CDs = 13 # Valid CDs = 13 # Full CDs = 0 KiXGolf Result = Valid CD Filling KiXGolf Score = 163
Thank you for participating in KiXtart Golf!
_________________________
Eric
|
Top
|
|
|
|
#99702 - 2003-03-24 02:44 PM
Re: KiXGolf: CD Sorter, Part II (public)
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Jens, have you have time to start the recap?
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 980 anonymous users online.
|
|
|