#178779 - 2007-08-07 09:18 AM
Re: KiXgolf: Top Secret
[Re: Jochen]
|
sixdoubleo
Starting to like KiXtart
Registered: 2004-02-06
Posts: 118
Loc: California, US
|
I had working code (testing with my own scripts) until I copied my function into kixgolf_udf. I failed all the tests.
After checking the ini, it turns out you are passing permutation as a comma-delimited string. In the examples on page one it shows "35214" as a string. So I had written my code to accept a flat string for permutation.
In practice, I think this would be cleaner... "35214" instead of "3,5,2,1,4"
So needless to say I have a little rewriting to do.
|
Top
|
|
|
|
#178780 - 2007-08-07 09:43 AM
Re: KiXgolf: Top Secret
[Re: sixdoubleo]
|
DrillSergeant
MM club member
Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
|
Ok, I did a rewrite...
I've tested it with this ini:
[Test 1]
Blocksize=5
Permutation=3,5,2,1,4
Input =Collegiate Programming Contest
Output=leoClaeigt orrPgmnmaio tCgntse
[test 2]
Blocksize=5
Permutation=3,5,2,1,4
Input =G, ,B
Output=B, ,G
[Test 3]
Blocksize=5
Permutation=3,5,2,1,4
Input ="ACM"
Output="MCA"
[Test 4]
Blocksize=5
Permutation=3,5,2,1,4
Input =Springfield, MA
Output=rnpSiilfgeA, Md
[Test 5]
Blocksize=5
Permutation=5,3,4,2,1
Input =Springfield, MA
Output=nripSliefgA, Md
[Test 6]
Blocksize=10
Permutation=3,5,2,1,4,6,10,9,8,7
Input =This is a very long text, something I hope will work
Output=iihT ss r evao glyn tstx, eehmotihI g neip owlr owlk
(changed permutation order in test 5, increased block-size in test 6)
and the result is:
KiXtart
KiXtart Version = 4.52
KiXGolf Script = kixgolf_ts.kix
Computer
OS = Windows XP Professional
CPU = Intel Pentium Model 13
Speed = 2261 MHz
Memory = 1024 MB
KiXGolf Scoring Engine
Scoring Engine = 3.3
KiXtart Golf Score
Tournament = Top Secret
Processing Start = 2007/08/07 09:37:43.312
Processing End = 2007/08/07 09:37:43.328
Duration = 0000/00/00 00:00:00.016
KiXGolf Score = 441
Thank you for participating in KiXtart Golf!
_________________________
The Code is out there
|
Top
|
|
|
|
#178781 - 2007-08-07 10:14 AM
Re: KiXgolf: Top Secret
[Re: DrillSergeant]
|
sixdoubleo
Starting to like KiXtart
Registered: 2004-02-06
Posts: 118
Loc: California, US
|
OK, are any points given out for "Most Brute-Force Implementation" ???
Too many unneeded variables, too many if/else/endifs, multiple passes through input string, long variable names, redundant debug steps, console display of variable contents...but it works...
Running Test 1 Encoding...Decoding...Done
Running Test 2 Encoding...Decoding...Done
Running Test 3 Encoding...Decoding...Done
Running Test 4 Encoding...Decoding...Done
Your solution passed all tests
KiXtart
KiXtart Version = 4.50
KiXGolf Script = kixgolf_ts.kix
Computer
OS = Windows 2000 Professional
CPU = AMD Athlon(tm) 64 X2 Dual Core Processor 5600+
Speed = 2798 MHz
Memory = 2046 MB
KiXGolf Scoring Engine
Scoring Engine = 3.3
KiXtart Golf Score
Tournament = Top Secret
Processing Start = 2007/08/07 01:05:22.008
Processing End = 2007/08/07 01:05:22.024
Duration = 0000/00/00 00:00:00.016
KiXGolf Score = 969
Thank you for participating in KiXtart Golf!
Guess I'll start stripping it down tomorrow....
I can't believe this was considered easy!
|
Top
|
|
|
|
#178782 - 2007-08-07 10:18 AM
Re: KiXgolf: Top Secret
[Re: DrillSergeant]
|
sixdoubleo
Starting to like KiXtart
Registered: 2004-02-06
Posts: 118
Loc: California, US
|
[Test 6] Blocksize=10 Permutation=3,5,2,1,4,6,10,9,8,7 Input =This is a very long text, something I hope will work Output=iihT ss r evao glyn tstx, eehmotihI g neip owlr owlk
Damn you! I just realized that two-digit position number will break my code.
Edited by sixdoubleo (2007-08-07 10:19 AM)
|
Top
|
|
|
|
#178805 - 2007-08-07 04:20 PM
Re: KiXgolf: Top Secret
[Re: Lonkero]
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
DrillSergeant, I added your tests #5 and #6 just to verify my code works as yours. It does but I do not seem to be able to trim very much at this time. I guess I need to ponder my approach and looping structure a little. Hopefully I can give you a little competition.
Running Test 1 Encoding...Decoding...Done Running test 2 Encoding...Decoding...Done Running Test 3 Encoding...Decoding...Done Running Test 4 Encoding...Decoding...Done Running Test 5 Encoding...Decoding...Done Running Test 6 Encoding...Decoding...Done Your solution passed all tests
KiXtart KiXtart Version = 4.52 KiXGolf Script = kixgolf_ts.kix
Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 1798 MHz Memory = 1024 MB
KiXGolf Scoring Engine Scoring Engine = 3.3
KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/07 10:16:25.996 Processing End = 2007/08/07 10:16:26.016 Duration = 0000/00/00 00:00:00.020 KiXGolf Score = 473
Thank you for participating in KiXtart Golf!
|
Top
|
|
|
|
#178818 - 2007-08-07 10:04 PM
Re: KiXgolf: Top Secret
[Re: Lonkero]
|
sixdoubleo
Starting to like KiXtart
Registered: 2004-02-06
Posts: 118
Loc: California, US
|
Im really anxious to see these solutions. I've got my code "down to" 589 and you guys are 470-490 right off the bat. There must be something I'm missing. Although I'm working fine with Drill Sargeant's latest tests...so that's good.
I have a couple ideas for optimizing but as soon as I start hammering out code my brain locks up. Must be getting old.
Edited by sixdoubleo (2007-08-07 10:05 PM)
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 628 anonymous users online.
|
|
|