|
|
|||||||
UPDATE 3:Clarified rules regarding characters and numbers, added a couple of test cases to package. UPDATE 2:A "new" test case 2 has been included by popular demand. UPDATE:Test case 2 has been removed from the package due to invalid test. Please either downlaod the new package or remove test case 2 from the .INI file. ============= The Challenge: Top Secret ============= A technique for encoding and decoding secret message is called cipher. The original message is called the plaintext, and the encoded message is called the ciphertext. One method for encoding message is transposition. The plaintext is first divided into blocks of equal length. We then choose a permutation to reorder the characters in each block. For example, if the block length is 5 and the permutation is 3 5 2 1 4 then the third character in each block becomes the first, the fifth becomes second, the second becomes third, the first becomes fourth and the fourth becomes fifth. Therefore, the message "Collegiate Programming Contest" is first divided into Code: Colle|giate| Progr|ammin|g Cont|est 12345|12345| 12345|12345|1 2345|123 and then permuted into Code: leoClaeigt orrPgmnmaio tCgntse Note that blanks and punctuations are not counted in any block, and should be left in their original positions. Note that the last block should be handled differently if it does not contain the full length of characters. In the example, the last block is "est". Since it contains only 3 characters, we eliminate 4 and 5 from the permutation "3 5 2 1 4" and use "3 2 1" to reorder the last block and get "tse". 1 <= Blocksize <= 10 Characters are a-z and A-Z only, numbers and other "special" characters, punctuations, blanks,... are to be left in their original positions. You are to write a function to implement this technique. The function will require four inputs: 1) the block length 2) the permutation 3) the message to be encoded or decoded 4) a parameter denoting encoding (E) or decoding (D) A download is available at http://s91376351.onlinehome.us/kixtart/kixgolf_ts.zip ============= Inputs & Outputs ============= Input: Blocklength, permutation, message, and code mode as outlined above Output: Properly encoded or decoded message. Please note that the strings will be tested in case-sensitive mode. ======= Scoring ======= The solution must pass all tests in order for it's KiXgolf Score to be considered. When posting KiXtart Golf Scores, please include the KIXGOLF_*.TXT file that is created in the script directory. It contains some basic information about the computer that the script is run on and the resulting scores. ============ Test program ============ Test cases are provided to help screen entries and to provide the Golf Score. Any script that passes the test cases can be submitted. If you are surprised that your solution passed the test cases, please submit it anyway! That will help me identify bugs in the test program. ================================================================ KiXtart GOLF - How To Play ================================================================ Most importantly, anybody can play, no age restrictions, no penalties, no handicap! The object in "real" golf is to hit the ball in the hole in the fewest strokes. The object in KiXtart Golf is to get from input (tee) to target (hole) in the fewest keystrokes. Example: How many positive elements are in array $a? Array $a could be of structure $a=[1, 2 ,-3, 4, -5, -7, 8, 9] One approach: Code: for $b=0 to ubound($a) if $a[$b]>0 $c=$c+1 endif next for a score of 45. Another solution is: Code: DO $b=$b+1 if $a[$b]>0 $c=$c+1 endif UNTIL $b>(UBOUND($a)+1) for a score of 53. Better approach: Code sample 1 ================================================================ KiXtart GOLF - The Rules ================================================================ 1) The goal of KiXtart Golf is to score the lowest strokes. 2) Strokes are all characters in a piece of code except whitespace characters, unless the whitespace character is necessary for the line of code to work. Therefore, carriage returns and line feeds do not count or spaces in between the '=' sign when assigning variables, e.g. '$a = $b' scores 5. 3) Code can be constructed any way you like, as long as it does not generate syntax or other errors when running the script in KiXtart. 4) The final solution MUST pass all test scripts that accompagny the KiXtart golf challenge. Some test scripts may not be included in the publicly available test suite but may be utilized as part of the official KiXgolf score verification. 7) During the private coding phase, no code is allowed to be posted. Violations result in disqualification of said player. 8) During the public coding phase, code should be posted, reused, and borrowed from other players. 9) The test script contains the official KiXgolf scoring engine 10) Only the person posting a particular score will be recognized for the score, unless the KiXtart Golf Challenge organizer or another delegate posts code on behalf of a player 11) KiXtart Golf (a.k.a KiXgolf) codes must be written inside the KiXgolf UDF collection tags, ';!' and ';!;!' 12) Parameter names of the UDF's can be changed and additional optional parameters can be added. 13) Additional helper UDFs can be written as long as they reside inside the ';!' and ';!;!' tags. 14) The use of '$' as a variable is allowed. 15) The UDF layout is up to coder. 16) The UDF is expected to finish in a reasonable time, that is, on modern computers inside 1 hour timeframe. 17) You can submit scores as often as you want. 18) If you reach leading score, you are obligated to post your score immediately so others can try to compete with you. 19) The UDF may only use the KiXtart/KiXforms commands/functions/macros, no other code fragments are allowed. 20) Calls to COM components that are part of a standard default Windows installation are allowed. 21) The use of the KiXforms DLL is also permitted as the KiXforms DLL can now be considered an integral part of KiXtart scripting. 22) Calls to other executables, as long as they are part of a standard default Windows installation are allowed. 23) The UDF should be self-contained (except for any I/O mentioned in the challenge). In particular, you may not do things like fetching extra data from a remote site or file. 24) You may assume ASCII as character set. 25) You may use block comments as the KiXgolf Scoring Engine now supports block comments. 26) You are allowed to only use publicly available versions of KiXtart and KiXforms, private builds or alpha builds are NOT allowed. 27) Your submitted score must include the result print of the KiXgolf test-engine. 28) The SETOPTION() parameters in the KiXgolf script may not be modified and will govern the script behavior. SETOPTION() parameters may change depending on the particular needs of the KiXgolf challenge. 29) Tokenizing the UDF, script, or portions thereof is not allowed. 30) If something is not explicitly denied by the rules, it's allowed. 31) If Confusion arises, arranger of the KiXgolf round has the final say. ================================================================ KiXtart GOLF - The Duration of the Competition ================================================================ 1) Private coding phase: From date/time of posting the tournament challenge to EST (BBS+6 time) 2) Public coding phase: From EST (BBS+6 time) to EST (BBS+6 time) 3) Final results: EST (BBS+6 time) You will need the complete package from http://s91376351.onlinehome.us/kixtart/kixgolf_ts.zip. |
||||||||
|
|
|||||||
Morning Jens, great to see the tournament rolling One observation: $sKiXGolfUDF is doubly defined in kixgolf_ts.kix, after deleting one of them it still dies on 'doubly defined udf' ... checking |
||||||||
|
|
|||||||
WTF ? @scriptname translates to KIXGOL~1.KIX which is splitjoined to KIXGOL~1.UDF which lets the script trying to call kixgolf3.3.udf AGAIN! Is it just my system or does anyone else suffer from short filename translation? |
||||||||
|
|
|||||||
Maybe your system? Script never complained to me about the double-defined variable or UDF. Also, cannot reproduce the tilde issue. What version KiXtart are you using? I removed the second variable definition and uploaded the corrected package. |
||||||||
|
|
|||||||
Quote: Note that blanks and punctuations are not counted in any block Punctuations.... Are we talking about anything outside of the alphabet, or just the comma and period? |
||||||||
|
|
|||||||
and WOW... I thought someone would have a working score by now. Who's playing so far? |
||||||||
|
|
|||||||
Quote: 1) the block length 2) the permutation Would there ever be a time where #1 could not be determined from #2? |
||||||||
|
|
|||||||
4.53 Found the UltraEdit Tools thing to be the cause. No problems running it from the command line. Maybe the UltraEdit Dos Command Window is a bit different. Funny that I never faced that problem before, running my scripts out of UE since ages btw, haven't really started to code, as it's weekend ... and it's not that trivial, at least for me |
||||||||
|
|
|||||||
Yes, I would say you can assume that the block length would not be longer than the permutation. But the block length could be shorter than the permutation, as shown in the example. |
||||||||
|
|
|||||||
Right... I just meant it seems kind of redundant to have an input that can be obtained from counting the elements of the perm. Did you see my other question about the punctuation? |
||||||||
|
|
|||||||
Anything that is not a letter or number would fall under the "punctuation" category. |
||||||||
|
|
|||||||
Jens, I think you have to review the test case #2. IMO encoding "leoClaeigt orrPgmnmaio tCgntse" with a permutation of 3,5,2,1,4 results not in "Collegiate Programming Contest",but in "olelCiteag rgroPminmaC ntogest" |
||||||||
|
|
|||||||
Jochen: You're correct. Test case 2 is invalid. I'm removing test case 2 from the package. Sorry for that, happens when you start modifying the test cases without fully testing them. |
||||||||
|
|
|||||||
I just realized that test case #2 was invalid as well. I wish I had refreshed my page sooner. Well I am half way there. All the encoding works. |
||||||||
|
|
|||||||
Hey Howard, me too, well, except for two escape characters in a row, and already have a score of 468 |
||||||||
|
|
|||||||
WAAAAHAHAHAHAH ... hah ... haha ... err .. My brain hurts Quote: Running Test 1 Encoding...Decoding...Done Running Test 3 Encoding...Decoding...Done Running Test 4 Encoding...Decoding...Done Your solution passed all tests KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows 2000 Professional CPU = Intel(R) Pentium(R) 4 CPU 2.80GHz Speed = 2793 MHz Memory = 504 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/06 15:06:04.828 Processing End = 2007/08/06 15:06:04.828 Duration = 0000/00/00 00:00:00.000 KiXGolf Score = 593 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
Let's get it on! Quote: Running Test 1 Encoding...Decoding...Done Running Test 3 Encoding...Decoding...Done Running Test 4 Encoding...Decoding...Done Your solution passed all tests KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows 2000 Professional CPU = Intel(R) Pentium(R) 4 CPU 2.80GHz Speed = 2793 MHz Memory = 504 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/06 16:15:12.921 Processing End = 2007/08/06 16:15:12.937 Duration = 0000/00/00 00:00:00.015 KiXGolf Score = 584 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
and... Quote: Running Test 1 Encoding...Decoding...Done Running Test 3 Encoding...Decoding...Done Running Test 4 Encoding...Decoding...Done Your solution passed all tests KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows 2000 Professional CPU = Intel(R) Pentium(R) 4 CPU 2.80GHz Speed = 2793 MHz Memory = 504 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/06 16:37:45.656 Processing End = 2007/08/06 16:37:45.671 Duration = 0000/00/00 00:00:00.014 KiXGolf Score = 582 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
Congrats Jochen... I think just getting this to work is an achievement in itself. I've started over 5 times now. So close each time... |
||||||||
|
|
|||||||
Thanx Allen, I daresay I can feel your pain |
||||||||
|
|
|||||||
Holly Cow! I thought this was suppose to be the easy one of the bunch, I just started looking at this, this AM, this could take a while to get something that is working! Jochen way to go, when did you start on this? |
||||||||
|
|
|||||||
Oh nooo! My code works with the given test cases but will fail on eg. Blocksize=5 Permutation=3,5,2,1,4 Input =G, ,B Output=B, ,G Will this disqualify the score ? By the way, are the double quotes in test case 3 (Input="ACM") intentional ? Because they are suppressed completely in the processing... Dale: Yesterday afternoon (my Timezone) |
||||||||
|
|
|||||||
btw, a fairly simple logical bug I built in the decoding part; Actually it should be gone with 3 or 5 more strokes. Just can't see the forrest for the trees atm |
||||||||
|
|
|||||||
Running Test 1 Encoding...Decoding...Done Running Test 3 Encoding...Decoding...Done Running Test 4 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/06 14:32:41.041 Processing End = 2007/08/06 14:32:41.051 Duration = 0000/00/00 00:00:00.010 KiXGolf Score = 502 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
NICE !!! What does it do with Blocksize=5 Permutation=3,5,2,1,4 Input =G, ,B Output=B, ,G ?? Edit: New score here is 557 (still not working on "G, ,B" ) |
||||||||
|
|
|||||||
Running Test 1 Encoding...Decoding...Done Running test 2 Encoding... ERROR : array reference out of bounds! Script: C:\Data\Scripts\Golf\kixgolf_ts\KIXGOLF_TS.udf Line : 25 Looking a little closer |
||||||||
|
|
|||||||
Wow I was a little confused there for a minute. I forgot to add the Blocksize to the test. [test 2] Blocksize=5 Permutation=3,5,2,1,4 Input =G, ,B Output=B, ,G once that was corrected: 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.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/06 14:44:42.282 Processing End = 2007/08/06 14:44:42.292 Duration = 0000/00/00 00:00:00.010 KiXGolf Score = 502 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
LOL, Sorry Howard, but this proofs your code to work in any case, right ? Plus it's 55 strokes shorter than mine edit: will edit my previous posts adding blocksize, not to confuse Jens, aye? |
||||||||
|
|
|||||||
Code: KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 798 MHz Memory = 1024 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/06 21:21:14.031 Processing End = 2007/08/06 21:21:14.046 Duration = 0000/00/00 00:00:00.014 KiXGolf Score = 540 Thank you for participating in KiXtart Golf! Here's my first attempt, now to start golfing down to below 500 |
||||||||
|
|
|||||||
Code: KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 798 MHz Memory = 1024 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/06 21:35:56.359 Processing End = 2007/08/06 21:35:56.359 Duration = 0000/00/00 00:00:00.000 KiXGolf Score = 511 Thank you for participating in KiXtart Golf! Look in your rearview mirror, howard! (I've also included new test 2, is it going to be mandatory?) |
||||||||
|
|
|||||||
We have to wait for Jens to judge... but I think it should be Nice going btw. |
||||||||
|
|
|||||||
Code: KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 798 MHz Memory = 1024 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/06 21:47:51.500 Processing End = 2007/08/06 21:47:51.515 Duration = 0000/00/00 00:00:00.014 KiXGolf Score = 485 Thank you for participating in KiXtart Golf! Ok, now to break that 400 btw, Jochen, congrats on the first working post, I did feel a slight tinge of jealousy there |
||||||||
|
|
|||||||
ok, I think I also should take a look at this one... |
||||||||
|
|
|||||||
Yeah, I was wondering what kept you. You usually post a working score about 5 minutes after the opening |
||||||||
|
|
|||||||
I will begin to tighten my code after dinner tonight. I hope you don't get too far ahead. |
||||||||
|
|
|||||||
Code: KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 798 MHz Memory = 1024 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/06 22:31:19.640 Processing End = 2007/08/06 22:31:19.656 Duration = 0000/00/00 00:00:00.016 KiXGolf Score = 465 Thank you for participating in KiXtart Golf! Eat my dust! |
||||||||
|
|
|||||||
hmm... not good. can't seem to get my head around the string manipulation... |
||||||||
|
|
|||||||
Dang it! I'm jealous. I have got to be over looking something so obvious. |
||||||||
|
|
|||||||
Code: KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 798 MHz Memory = 1024 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/06 22:39:18.546 Processing End = 2007/08/06 22:39:18.562 Duration = 0000/00/00 00:00:00.016 KiXGolf Score = 459 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
Wow, still have too many fors, ifs and the corresponding closing keywords in it to beat that (543 atm), and the not yet official test case 2 is still escaping me ... What have I done [edit: Thanks for deleting the superflous posts, whoever it was, dunno whats going on |
||||||||
|
|
|||||||
534 in the mean time ... will have to fix the decoding part and rearrange completely to close up to Rogier |
||||||||
|
|
|||||||
ehm... I'm going to retract my scores... I realised my script fails on block sizes bigger than 10. I think I'll stay under 500 with a rewrite, but I'm not sure... |
||||||||
|
|
|||||||
OMG!!! I don't even dare to think of changing the block sizes (You HAVE also changed the Permutation, dontcha? ) |
||||||||
|
|
|||||||
ok... jens, you really need to define what are the characters and numbers. don't want americans using a-z while northern europeans would need to count for a-z + åäö and all their variants. |
||||||||
|
|
|||||||
and define a maximum block size |
||||||||
|
|
|||||||
256? |
||||||||
|
|
|||||||
254 would suit me better |
||||||||
|
|
|||||||
currently doesn't really matter to me. don't wanna bloat the darn code but any idea I have results in too big code to my liking. |
||||||||
|
|
|||||||
In practical use, wouldn't you want to NOT ignore spaces/punctuation? Seems more obfuscated that way... Course it makes the code a lot easier too. |
||||||||
|
|
|||||||
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.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/06 18:24:50.144 Processing End = 2007/08/06 18:24:50.164 Duration = 0000/00/00 00:00:00.020 KiXGolf Score = 490 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
damn I hate how kixtart handles errors nowadays! "error in expression on line 123" I go check line 123, it says: $s=$g F, that's so bloody wrong. and to count for missing quotes, commenting out that line stops the crashing but obviously it no longer works correctly. |
||||||||
|
|
|||||||
k, I must give up for this day. simple dim line keeps erroring and haven't figured out why the first error occured either. need to sleep before I throw this laptop out the window. |
||||||||
|
|
|||||||
Ah, seems we now got something going here. I'm including the "new" test case 2, ZIP file has been updated accordingly. I'm also clarifying the following: 1 <= Blocksize <= 10 Characters are a-z and A-Z |
||||||||
|
|
|||||||
Originally Posted By: Sealeopard I'm including the "new" test case 2, ZIP file has been updated accordingly. All my own fault ... *hits himself with keyboard* latest result: Quote: 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 failed 1 of 8 tests. KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 15 Speed = 2399 MHz Memory = 2048 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/06 23:16:05.593 Processing End = 2007/08/06 23:16:05.593 Duration = 0000/00/00 00:00:00.000 KiXGolf Score = 534 Thank you for participating in KiXtart Golf! Guess which case fails [Spoiler: Case 2 decoding ] |
||||||||
|
|
|||||||
GAH! I'm out of time. Maybe later in the week I'll try again. |
||||||||
|
|
|||||||
Remember that the private round is going to end on Wednesday |
||||||||
|
|
|||||||
I tried a completely different approach... KiXGolf Score = 482 Without the decode logic. I guess I will go back and tweak my 490 code. |
||||||||
|
|
|||||||
How do you find the time, I have barely had a chance to look at the challenge much less do any coding on it. Have thought about it frequently, but just can't seem to find the time to do anything about it. |
||||||||
|
|
|||||||
gargoyle, I have the exact same problem. sadly. |
||||||||
|
|
|||||||
Have to correct my intermediate result from 534 back to 546 ... Had a logic flaw on escape chars > asc(90) |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
Ok, I did a rewrite... I've tested it with this ini: Code: [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: Code: 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! |
||||||||
|
|
|||||||
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... Code: 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! |
||||||||
|
|
|||||||
Originally Posted By: DrillSergeant [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. |
||||||||
|
|
|||||||
that's why I had to rewrite mine too |
||||||||
|
|
|||||||
Code: 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 10:38:59.390 Processing End = 2007/08/07 10:38:59.406 Duration = 0000/00/00 00:00:00.016 KiXGolf Score = 425 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
OMFG!!!! I got case 2 working now, but then case 1 decoding fails |
||||||||
|
|
|||||||
To clarify: Originally Posted By: Sealeopard Characters are a-z and A-Z Originally Posted By: Sealeopard Anything that is not a letter or number would fall under the "punctuation" category. So we can assume that there will never be a message with numbers in it? |
||||||||
|
|
|||||||
Eh ? I read that punctuation is anything except a-z, A-Z and 0-9 |
||||||||
|
|
|||||||
yes, but in the first post it's stated that valid characters are a-z and A-Z (not 0-9) |
||||||||
|
|
|||||||
Right, I will start over from scratch, the way I try to do this thing contains too much traps ... Even created a test case where encoding fails. Forget the scores I posted so far |
||||||||
|
|
|||||||
I got an hour but never got that darn waste-piece code working. need to do some work now. |
||||||||
|
|
|||||||
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! |
||||||||
|
|
|||||||
As it seems to be right now you'll be at least second anyway |
||||||||
|
|
|||||||
Thanks Jochen... I didn't realize it ended on Wed... I don't know if I will have enough time to mess with this anymore... |
||||||||
|
|
|||||||
yihaa. finally got my encoding working. 482. uhm. |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
sixdoubleo, if you have working code you should post your score asap. You get points for being in the top 5 first posters, and as far as i can see you're the third one with woking code (because Jochen retracted his scores) |
||||||||
|
|
|||||||
top5 as in rank. there is no points for speed per jens' last rule change. back to the basics... shouldn't this qualify as ok result: Quote: failed: Collegiate Programming Contest =! Collegiate Programming Contets it's soooo close :p |
||||||||
|
|
|||||||
Originally Posted By: Jooel top5 as in rank. there is no points for speed per jens' last rule change. Ah, that's indeed more honest with the global time zones and all... |
||||||||
|
|
|||||||
and that's why I haven't worried about the speed of inventing the solution. just need to make one in time. |
||||||||
|
|
|||||||
hmm... could someone explain a bit. me too tired or something but... how can one know, what is the correct location of the last characters. as example: A, Md with permutation of: 3,5,2,1,4 results in decoding: d, AM wtf? the correct result would be: d, MA what I'm not seeing? |
||||||||
|
|
|||||||
because on 3 letters A, Md you have a permutation of 321 instead of 35214. You have to take out the 5 and 4 positions before you decode. Code: A, Md 3 21 d, MA 1 23 |
||||||||
|
|
|||||||
not sure that I understand, but thanks. that leads to only one outcome: Code: Your solution passed all tests KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 00:59:46.765 Processing End = 2007/08/08 00:59:46.890 Duration = 0000/00/00 00:00:00.125 KiXGolf Score = 509 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
which comes to: Code: KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 01:01:32.234 Processing End = 2007/08/08 01:01:32.250 Duration = 0000/00/00 00:00:00.016 KiXGolf Score = 501 |
||||||||
|
|
|||||||
Your solution passed all tests KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 01:10:03.640 Processing End = 2007/08/08 01:10:03.671 Duration = 0000/00/00 00:00:00.030 KiXGolf Score = 492 |
||||||||
|
|
|||||||
Your solution passed all tests KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 01:21:04.671 Processing End = 2007/08/08 01:21:04.687 Duration = 0000/00/00 00:00:00.015 KiXGolf Score = 483 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
Your solution passed all tests KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 01:24:16.859 Processing End = 2007/08/08 01:24:16.875 Duration = 0000/00/00 00:00:00.015 KiXGolf Score = 473 |
||||||||
|
|
|||||||
Your solution passed all tests KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 01:31:21.171 Processing End = 2007/08/08 01:31:21.203 Duration = 0000/00/00 00:00:00.032 KiXGolf Score = 471 . did I just pass hoby? |
||||||||
|
|
|||||||
Your solution passed all tests KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 01:43:47.625 Processing End = 2007/08/08 01:43:47.625 Duration = 0000/00/00 00:00:00.000 KiXGolf Score = 467 |
||||||||
|
|
|||||||
k, just to clarify, here is the current standing: Code: drill - 425 jooel - 467 hoby - 473 sixdoubleo - 969 jochen's codes keep on failing |
||||||||
|
|
|||||||
Originally Posted By: Jooel k, just to clarify, here is the current standing: Code: drill - 425 jooel - 467 hoby - 473 sixdoubleo - 969 jochen's codes keep on failing Hey! That was my initial code. I'm at 589 currently. Code: 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.50 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel(R) Pentium(R) 4 CPU 3.00GHz Speed = 2992 MHz Memory = 2040 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/07 11:11:17.955 Processing End = 2007/08/07 11:11:17.970 Duration = 0000/00/00 00:00:00.014 KiXGolf Score = 589 Thank you for participating in KiXtart Golf! D:\Dev\kix\Golf\Week1> |
||||||||
|
|
|||||||
hmm... making my code hardcoded to work only with blocksizes 1-10, makes the score: Code: KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 02:08:52.562 Processing End = 2007/08/08 02:08:52.578 Duration = 0000/00/00 00:00:00.016 KiXGolf Score = 463 just feels stupid... loose so much with just 4 strokes. |
||||||||
|
|
|||||||
k, I just glanced at your post back there and read something like "I'm just getting around 580 when you guys get lot less" like if you were crying aloud, not posting score |
||||||||
|
|
|||||||
Code: KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 02:20:35.671 Processing End = 2007/08/08 02:20:35.687 Duration = 0000/00/00 00:00:00.015 KiXGolf Score = 461 |
||||||||
|
|
|||||||
Code: Your solution passed all tests KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 02:27:13.000 Processing End = 2007/08/08 02:27:13.031 Duration = 0000/00/00 00:00:00.031 KiXGolf Score = 457 |
||||||||
|
|
|||||||
Code: KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 02:33:24.703 Processing End = 2007/08/08 02:33:24.734 Duration = 0000/00/00 00:00:00.031 KiXGolf Score = 455 |
||||||||
|
|
|||||||
Your solution passed all tests KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 02:37:36.453 Processing End = 2007/08/08 02:37:36.468 Duration = 0000/00/00 00:00:00.015 KiXGolf Score = 453 |
||||||||
|
|
|||||||
so, now as I go to bed, it's: Code: drill - 425 jooel - 453 howard - 473 sixdoubleo - 589 jochen still has no working code |
||||||||
|
|
|||||||
I am finally below 500... Code: Your solution passed all tests KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows Vista Business Edition 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 20:27:42.928 Processing End = 2007/08/07 20:27:42.959 Duration = 0000/00/00 00:00:00.031 KiXGolf Score = 495 Thank you for participating in KiXtart Golf! I still have a lot to learn. Like splitting a string into an array. I could have sworn that this was valid... $s = "Hello" $a = Split($s,"") such that $a = "H","e","l","l","o" I think I could pick up about 20 characters if I could do that. |
||||||||
|
|
|||||||
Originally Posted By: Jooel top5 as in rank. there is no points for speed per jens' last rule change. back to the basics... shouldn't this qualify as ok result: Quote: failed: Collegiate Programming Contest =! Collegiate Programming Contets it's soooo close :p LOL, I got this result on Monday morning too This round should be labeled: Caution, Insanity Inside! btw. I have started a promising approach yesterday, but haven't got too much time for it. Which time will it end today ? |
||||||||
|
|
|||||||
Jochen, afaik the deadline is midnight, Wednesday, Boston Time: http://www.timeanddate.com/worldclock/fi...n=0&sec=0&p1=43 So you have until thursday morning 6.00 |
||||||||
|
|
|||||||
Well, I think I am about at my coding limits here....gonna hang it up for tonight at a 461. Code: Your solution passed all tests KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows Vista Business Edition 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 23:07:15.733 Processing End = 2007/08/07 23:07:15.760 Duration = 0000/00/00 00:00:00.027 KiXGolf Score = 461 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
nice. now we just need to wait for response from howard. 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.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 09:52:13.266 Processing End = 2007/08/08 09:52:13.297 Duration = 0000/00/00 00:00:00.030 KiXGolf Score = 451 Thank you for participating in KiXtart Golf! Press any key to continue... |
||||||||
|
|
|||||||
I rewrote my code using another approach that looked promising, but I got stuck handing the last incomplete block characters. My new approach is still a step backward: 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/08 02:57:24.829 Processing End = 2007/08/08 02:57:24.859 Duration = 0000/00/00 00:00:00.030 KiXGolf Score = 538 |
||||||||
|
|
|||||||
whilst I'm getting ahead... 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.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 10:14:59.753 Processing End = 2007/08/08 10:14:59.784 Duration = 0000/00/00 00:00:00.031 KiXGolf Score = 438 Thank you for participating in KiXtart Golf! Press any key to continue... |
||||||||
|
|
|||||||
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.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 10:29:00.988 Processing End = 2007/08/08 10:29:01.019 Duration = 0000/00/00 00:00:00.031 KiXGolf Score = 433 Thank you for participating in KiXtart Golf! Press any key to continue... |
||||||||
|
|
|||||||
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.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 12:21:46.585 Processing End = 2007/08/08 12:21:46.617 Duration = 0000/00/00 00:00:00.031 KiXGolf Score = 429 Thank you for participating in KiXtart Golf! Press any key to continue... |
||||||||
|
|
|||||||
Nice, only 5 to take the lead |
||||||||
|
|
|||||||
But I've also been busy 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/08 11:30:28.656 Processing End = 2007/08/08 11:30:28.671 Duration = 0000/00/00 00:00:00.014 KiXGolf Score = 394 Thank you for participating in KiXtart Golf! btw, if numbers are not allowed in the message body, I've got a score of 386 |
||||||||
|
|
|||||||
talk about holding back the leading score! |
||||||||
|
|
|||||||
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 = 2261 MHz Memory = 1024 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 11:55:52.109 Processing End = 2007/08/08 11:55:52.125 Duration = 0000/00/00 00:00:00.016 KiXGolf Score = 388 Thank you for participating in KiXtart Golf! (Without numbers in message: score = 380) |
||||||||
|
|
|||||||
Originally Posted By: Jooel talk about holding back the leading score! Naw, I was getting nervous with you on my heels so I decided to have a new look at my code and I found that I could combine two loops in one. I don't hold back scores, if I did we would be playing kixpoker instead of kixgolf |
||||||||
|
|
|||||||
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 = 2261 MHz Memory = 1024 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 12:21:22.796 Processing End = 2007/08/08 12:21:22.812 Duration = 0000/00/00 00:00:00.015 KiXGolf Score = 372 Thank you for participating in KiXtart Golf! (Without numbers in message: score = 364) |
||||||||
|
|
|||||||
hmm... Code: KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 13:36:40.528 Processing End = 2007/08/08 13:36:40.559 Duration = 0000/00/00 00:00:00.031 KiXGolf Score = 427 those 2 strokes made my script look really ugly, but it's shorter alright. just a note on the test-cases, they kinda suck. should test the block sizes. current tests have similar permutations. and current tests only have characters, spaces and comma's. what about the numbers and all other funcy characters? |
||||||||
|
|
|||||||
Jooel, I've been testing with this ini: Code: [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 It's got a different permutation in Test 5 and a Block length = 10 in Test 6. In the rules message is the text: Quote: Note that blanks and punctuations are not counted in any block, and should be left in their original positions. Note that the last block should be handled differently if it does not contain the full length of characters. In the example, the last block is "est". Since it contains only 3 characters, we eliminate 4 and 5 from the permutation "3 5 2 1 4" and use "3 2 1" to reorder the last block and get "tse". 1 <= Blocksize <= 10 Characters are a-z and A-Z and later on Jens says: Quote: Anything that is not a letter or number would fall under the "punctuation" category. This means that any character other than a letter is considered a punctuation. That's also why I'm not sure if a number is a valid character in the message body... |
||||||||
|
|
|||||||
k... slowly getting shorter... 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.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 13:55:08.163 Processing End = 2007/08/08 13:55:08.195 Duration = 0000/00/00 00:00:00.031 KiXGolf Score = 422 Thank you for participating in KiXtart Golf! Press any key to continue... |
||||||||
|
|
|||||||
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 = 2261 MHz Memory = 1024 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 12:55:23.437 Processing End = 2007/08/08 12:55:23.453 Duration = 0000/00/00 00:00:00.016 KiXGolf Score = 370 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
Code: KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 13:59:05.562 Processing End = 2007/08/08 13:59:05.594 Duration = 0000/00/00 00:00:00.031 KiXGolf Score = 421 |
||||||||
|
|
|||||||
I've added some other testcases that meet the criteria (one is with numbers ): Code: [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 [Test 7] Blocksize=7 Permutation=6,3,5,1,7,2,4 Input =And it's 1, 2, 3, what are we fightin' for? Output=sdt Aw'n 1, 2, 3, ietr hwa at iheifgo' nfr? [Test 8] Blocksize=2 Permutation=2,1 Input = A, Output= A, If anyone can think of another test case, I'll be glad to put my code to the test... |
||||||||
|
|
|||||||
Case added: Code: [Test 9] Blocksize=4 Permutation=3,1,4,2 Input =Is a circonflex (^) considered punctuation? Output=aI c sciorlnefo (^) xncdseidrp ecutntuiaon? |
||||||||
|
|
|||||||
Quote: [Test 10] Blocksize=100 Permutation=15,99,7,12,51,39,62,25,34,59,69,92,31,58,40,16,57,52,18,70,100,6,47,20,74,35,83,77,41,66, 80,42,33,36,73,29,45,56,27,32,2,98,28,95,65,4,79,46,11,63,38,13,93,67,88,22,96,76,89,85,19,84,61,43,97,53,86, 94,60,37,50,24,48,23,78,5,87,68,14,1,49,64,9,91,81,17,54,82,90,44,10,30,21,75,3,55,71,8,26,72 Input =Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this. But, in a larger sense, we can not dedicate -- we can not consecrate -- we can not hallow -- this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us -- that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion -- that we here highly resolve that these dead shall not have died in vain -- that this nation, under God, shall have a new birth of freedom -- and that government of the people, by the people, for the people, shall not perish from the earth. Output=vaod hutor ntn tiget iyitc hao sne hwetebc frnuhoc reerv tn aosd nrsdctieL, n fis bdertg, oaiseaeFn ne adnciyo, aar nuooronto eo eeg leivtedqiee nirh whr ahs utn artaaog ecdnn. tao iw prd sncrtie tt t ealon haner lea, tteiiea eragogw hNor attalp, mw cii croaod ge maanenevf cte dd crtgtteea, liu oetn ddoana. ro tlo etv nd f eeeWe nemhtr-nasWd ha alna ebn. ow ieac dsca oy tiodehar o wltatav ir gaae hfelo, he a iihcr nesnhar riets nIi attnh pfv lgdt thni oefio mevge soaa piit aseila thtto ollt. ee st ftgnetrtct ueetssh ang ddohnr tlte io nsodaw te ahon. ten, ea i taoiet epcwc, op ceB aen wwdaraec -- ts dnt lnf annroruieo -- eg sir hcu dwglec -- egaa wvhane. eTt ooret aor, deownn ils reih, dnt slbtsodre coro, arrh uehadprvdgv ua, alo rotgn hov dhep oiibf ae etm dl rcweeil. lbv enemd rsie uahlro hten, amr notr enodooia thwe tr oIn dise, hyl et bfa dtugw tatwri errt cTrt wyt eehe. lg eh rte fe eva ruwcth, hyetnr, hk ot dieeeofvf ohie tr dsc trtcevfeth rhet aunea aorb ayn nwsdeh oidd elog hswo nlu th sbigh dhhihiae. sa to irueoo rke fe te nb osar hetdhaaot th has bidte cnhs nkfsgretw rceeee de -- tria irea deeor dfuImte aron et arte sigmhdtae toahtwge tt hdet fsawa ols raeil tlay vehf oie ddce nehu tittthe fs htousose -- ulhv ee rlog vvahem ooaycrr htnt eedee ihhi lnvhn tht bets wdee ai delh -- vnie hefg raoahd, ntnsp tpf, atsah uehr n iet tnnrr Go vmeinlt -- ana leed dlotfodevo oh iad haooam, te frh rtohpp, roi mte snelpy, lhaef ole hhstee rbhp eel optoa. ok, it's outside the requirements... but it still works! The permutation should be on one line, I've split it into three lines because it would have mucked up the layout. |
||||||||
|
|
|||||||
your solution failed 2 of 16 tests. hmm... need to recheck. |
||||||||
|
|
|||||||
I am back in the race! Got the encoding part working rock solid with a score of 416 (non-optimized). The decoding should be only a matter of a few strokes (hopefully). Need a rest of a couple hrs ... brain hurts too much |
||||||||
|
|
|||||||
Can we REALLY consider numbers as punctuation (escape chars) ? If so, I would save 10 strokes :p [edit: gone reading the first post |
||||||||
|
|
|||||||
Jochen, the only valid characters are a-z and A-Z. This means that numbers definately do not have to be included in the encoding - decoding. My question is if numbers are valid in a message because, as far as i can find in the rules, the message can only contain valid characters and punctuation (eg: no numbers). |
||||||||
|
|
|||||||
Right, 10 strokes saved then. I think that if anything except A-Z and a-z is punctuation, then numbers are as well punctuation, it's only a matter of shifting them around or not, aye? |
||||||||
|
|
|||||||
Ehm... not really, Jochen, but I'll show you why in the public round 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 Running Test 7 Encoding...Decoding...Done Running Test 8 Encoding...Decoding...Done Running Test 9 Encoding...Decoding...Done Running Test 10 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 = 2261 MHz Memory = 1024 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 15:06:12.406 Processing End = 2007/08/08 15:06:12.812 Duration = 0000/00/00 00:00:00.405 KiXGolf Score = 369 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
OMG, IT WORKS !!!1! 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.53 KiXGolf Script = KIXGOL~1.KIX Computer OS = Windows 2000 Professional CPU = Intel(R) Pentium(R) 4 CPU 2.80GHz Speed = 2793 MHz Memory = 504 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 15:23:15.375 Processing End = 2007/08/08 15:23:15.390 Duration = 0000/00/00 00:00:00.014 KiXGolf Score = 421 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
Code: Current standing: DrillSergeant 369 Jooel/Jochen 421 Sixdoubleo 461 Howard 473 The scores are based on test case 1-4. Cases 5 - 9 are not (yet) official tests. Case 10 is outside the requirements, it's just for fun. Test cases 1-10: Quote: [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 [Test 7] Blocksize=7 Permutation=6,3,5,1,7,2,4 Input =And it's 1, 2, 3, what are we fightin' for? Output=sdt Aw'n 1, 2, 3, ietr hwa at iheifgo' nfr? [Test 8] Blocksize=2 Permutation=2,1 Input = A, Output= A, [Test 9] Blocksize=4 Permutation=3,1,4,2 Input =Is a circonflex (^) considered punctuation? Output=aI c sciorlnefo (^) xncdseidrp ecutntuiaon? [Test 10] Blocksize=100 Permutation=15,99,7,12,51,39,62,25,34,59,69,92,31,58,40,16,57,52,18,70,100,6,47,20,74,35,83,77,41, 66,80,42,33,36,73,29,45,56,27,32,2,98,28,95,65,4,79,46,11,63,38,13,93,67,88,22,96,76,89,85,19,84,61,43,97,53,86, 94,60,37,50,24,48,23,78,5,87,68,14,1,49,64,9,91,81,17,54,82,90,44,10,30,21,75,3,55,71,8,26,72 Input =Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this. But, in a larger sense, we can not dedicate -- we can not consecrate -- we can not hallow -- this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us -- that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion -- that we here highly resolve that these dead shall not have died in vain -- that this nation, under God, shall have a new birth of freedom -- and that government of the people, by the people, for the people, shall not perish from the earth. Output=vaod hutor ntn tiget iyitc hao sne hwetebc frnuhoc reerv tn aosd nrsdctieL, n fis bdertg, oaiseaeFn ne adnciyo, aar nuooronto eo eeg leivtedqiee nirh whr ahs utn artaaog ecdnn. tao iw prd sncrtie tt t ealon haner lea, tteiiea eragogw hNor attalp, mw cii croaod ge maanenevf cte dd crtgtteea, liu oetn ddoana. ro tlo etv nd f eeeWe nemhtr-nasWd ha alna ebn. ow ieac dsca oy tiodehar o wltatav ir gaae hfelo, he a iihcr nesnhar riets nIi attnh pfv lgdt thni oefio mevge soaa piit aseila thtto ollt. ee st ftgnetrtct ueetssh ang ddohnr tlte io nsodaw te ahon. ten, ea i taoiet epcwc, op ceB aen wwdaraec -- ts dnt lnf annroruieo -- eg sir hcu dwglec -- egaa wvhane. eTt ooret aor, deownn ils reih, dnt slbtsodre coro, arrh uehadprvdgv ua, alo rotgn hov dhep oiibf ae etm dl rcweeil. lbv enemd rsie uahlro hten, amr notr enodooia thwe tr oIn dise, hyl et bfa dtugw tatwri errt cTrt wyt eehe. lg eh rte fe eva ruwcth, hyetnr, hk ot dieeeofvf ohie tr dsc trtcevfeth rhet aunea aorb ayn nwsdeh oidd elog hswo nlu th sbigh dhhihiae. sa to irueoo rke fe te nb osar hetdhaaot th has bidte cnhs nkfsgretw rceeee de -- tria irea deeor dfuImte aron et arte sigmhdtae toahtwge tt hdet fsawa ols raeil tlay vehf oie ddce nehu tittthe fs htousose -- ulhv ee rlog vvahem ooaycrr htnt eedee ihhi lnvhn tht bets wdee ai delh -- vnie hefg raoahd, ntnsp tpf, atsah uehr n iet tnnrr Go vmeinlt -- ana leed dlotfodevo oh iad haooam, te frh rtohpp, roi mte snelpy, lhaef ole hhstee rbhp eel optoa. * Permutation of case 10 should be on one line, it's divided in three segments to preserve html layout |
||||||||
|
|
|||||||
Oi Rogier, Howards 473 score on page 3 should be rewarded, nay? |
||||||||
|
|
|||||||
oops... corrected |
||||||||
|
|
|||||||
hey, if no numbers, then I will have: 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 Running Test 7 Encoding...failed. Decoding...failed. Running Test 8 Encoding...Decoding...Done Running Test 9 Encoding...Decoding...failed. Your solution failed 3 of 18 tests. KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 17:55:09.109 Processing End = 2007/08/08 17:55:09.250 Duration = 0000/00/00 00:00:00.141 KiXGolf Score = 409 Thank you for participating in KiXtart Golf! Press any key to continue... and that's fine with the first 4 and puts me back to second place |
||||||||
|
|
|||||||
I demand Jens to update the test cases to the ones Rogier supposed (except 10) and make clear if Numbers can be inside the input (probably ammending case 7 if not) ... I don't know yet why, but my code denies to shift characters before a number in a block ... This is just annoying! Plus maybe add some extra time to the private round |
||||||||
|
|
|||||||
can't really see what's so different in the test 7 that makes my code fail both enc and decode. weird. or why two of the new tests are so different that they fail on decode. |
||||||||
|
|
|||||||
hmm... think I found it... either need to add strokes or redesing the udf. think the latter is more fun |
||||||||
|
|
|||||||
I did it. reworked the udf to work with all 9 cases: 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 Running Test 7 Encoding...Decoding...Done Running Test 8 Encoding...Decoding...Done Running Test 9 Encoding...Decoding...Done Your solution passed all tests KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 20:04:46.078 Processing End = 2007/08/08 20:04:46.203 Duration = 0000/00/00 00:00:00.125 KiXGolf Score = 453 Thank you for participating in KiXtart Golf! Press any key to continue... |
||||||||
|
|
|||||||
Hmmm... Using my 473 code and the 10 tests, I get: Quote: 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 Running Test 7 Encoding... Failed Decoding...Done Running Test 8 Encoding... Failed Decoding... Failed Done Running Test 9 Encoding... Failed Decoding... ERROR : array reference out of bounds! Script: C:\Data\Scripts\Golf\kixgolf_ts\KIXGOLF_TS.udf Line : 60 Using mt 538 code: Quote: 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 Running Test 7 Encoding... Failed Decoding...Done Running Test 8 Encoding...Decoding...Done Running Test 9 Encoding...Decoding...Done Running Test 10 Encoding... Failed Decoding... Failed Done Your solution failed 3 of 20 tests. KiXtart KiXtart Version = 4.52 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 1799 MHz Memory = 1024 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 13:34:58.813 Processing End = 2007/08/08 13:34:58.984 Duration = 0000/00/00 00:00:00.170 KiXGolf Score = 538 I guess I have a little fixing to do, but I can not seem to get anywhere near the scores IU have seen posted. All of my code is supposed to be capable of processing numbers. |
||||||||
|
|
|||||||
Howard, Test 5, 6, 8 and 9 meet current requirements and should work. Test 7 is questionable because we need a ruling if a message can contain numbers. Test 10 is outside of the requirements (1 <= block size <= 10) so you do not have to worry about that one. Jooel, Nice going, now take out the putter and stroke away! |
||||||||
|
|
|||||||
I take the failures of #7 and #10 as a personal failure to author proper and robust code. My design should have been able to accomodate these cases. I need to first validate the INI file test data in case it is not properly constructed. Secondly I need to fix the code. |
||||||||
|
|
|||||||
test 7 should anyways always decode back fine. both ways, numbers as punc or as data. anyways, my new code does actually what I wanted it to do. it works perfectly with all 10 tests! KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 20:50:03.687 Processing End = 2007/08/08 20:50:04.328 Duration = 0000/00/00 00:00:00.640 KiXGolf Score = 423 KiXGolf Result = Solution passed all 20 tests Thank you for participating in KiXtart Golf! if someone wonders my output, I changed the sOutput. first to make it look ok on the board and then added the actual result to the result-section. in the original version if someone took the file and copy-pasted it on board, it wouldn't have said if the result was a failure or success. |
||||||||
|
|
|||||||
Originally Posted By: Jooel if someone wonders my output, I changed the sOutput. first to make it look ok on the board and then added the actual result to the result-section. in the original version if someone took the file and copy-pasted it on board, it wouldn't have said if the result was a failure or success. Posting scores that don't generate a success would come out in the public round anyway, so I can't imagine why anyone would do that. |
||||||||
|
|
|||||||
just personal preference. also, with that line, one can see how many tests were performed over all. |
||||||||
|
|
|||||||
YIHAAA!!!!!!!! KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 21:11:17.593 Processing End = 2007/08/08 21:11:18.546 Duration = 0000/00/00 00:00:00.953 KiXGolf Score = 378 KiXGolf Result = Solution passed all 20 tests Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
I think your Test #7 data is incorrect: [Test 7] Blocksize=7 Permutation=6,3,5,1,7,2,4 Input =And it's 1, 2, 3, what are we fightin' for? Output=sdt Aw'n 1, 2, 3, ietr hwa at iheifgo' nfr? Output should be: Output=sdt A1'n i, t, w, a2a3 hiw fr geeoifh' rtn? Because the last statement states letters and numbers. Alphanumeric messages makes sense. |
||||||||
|
|
|||||||
KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 21:17:46.421 Processing End = 2007/08/08 21:17:47.265 Duration = 0000/00/00 00:00:00.843 KiXGolf Score = 367 KiXGolf Result = Solution passed all 20 tests Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
hoby, yeah. his test7 is made on assumption that numerics are punctutations. |
||||||||
|
|
|||||||
KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 21:25:14.984 Processing End = 2007/08/08 21:25:15.984 Duration = 0000/00/00 00:00:01.000 KiXGolf Result = Solution passed all 20 tests KiXGolf Score = 366 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
Excellent job. I can not even think how my code could ever be as small. Can't wait to see it. |
||||||||
|
|
|||||||
tested my code, and making it work with numbers as part of data gets me to 380 |
||||||||
|
|
|||||||
Originally Posted By: Howard Bullock I think your Test #7 data is incorrect: [Test 7] Blocksize=7 Permutation=6,3,5,1,7,2,4 Input =And it's 1, 2, 3, what are we fightin' for? Output=sdt Aw'n 1, 2, 3, ietr hwa at iheifgo' nfr? Output should be: Output=sdt A1'n i, t, w, a2a3 hiw fr geeoifh' rtn? Because the last statement states letters and numbers. Alphanumeric messages makes sense. I can change my code also to use numbers as data, but Jens's first post says: valid characters are a-z and A-Z |
||||||||
|
|
|||||||
Well, where is a Jens when we need one |
||||||||
|
|
|||||||
Right then, it's getting late... need to do some prepare for my vacation starting on Saturday. I hopefully get my code fixed for both static and moving numbers. Funny how when there are numbers in the block treated as static all prior to the first number freezes as well. Well, not really funny, quite puzzling |
||||||||
|
|
|||||||
one more on the numbers. I really like the idea for them to be handled as part of the data. but, anywho, jens added his definition of 1-10 block and a-z & A-Z later to his original post and none of the tests provide way to determine between either. so, think we need to go with number=punct basically jens has right to rule over this, but it's already getting midnight here, so it would be unfair to redefine the rules when some of us have no chance of adapting. |
||||||||
|
|
|||||||
I agree with Jooel. I also realise that my design would be different with alphanumeric characters instead of only letters. That being said... 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 Running Test 7 Encoding...Decoding...Done Running Test 8 Encoding...Decoding...Done Running Test 9 Encoding...Decoding...Done Running Test 10 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 = 2261 MHz Memory = 1024 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 21:30:36.382 Processing End = 2007/08/08 21:30:36.741 Duration = 0000/00/00 00:00:00.358 KiXGolf Score = 361 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
damn |
||||||||
|
|
|||||||
wicked... KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 23:06:23.250 Processing End = 2007/08/08 23:06:24.125 Duration = 0000/00/00 00:00:00.875 KiXGolf Result = Solution passed all 20 tests KiXGolf Score = 362 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
ok, now we are even. KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/08 23:13:25.078 Processing End = 2007/08/08 23:13:25.968 Duration = 0000/00/00 00:00:00.889 KiXGolf Result = Solution passed all 20 tests KiXGolf Score = 361 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
wohoo! KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/09 00:11:24.296 Processing End = 2007/08/09 00:11:25.296 Duration = 0000/00/00 00:00:01.000 KiXGolf Result = Solution passed all 20 tests KiXGolf Score = 358 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
Ok, then we agree to count numbers as punctuation? If so, my (in the mean time partly corrected) code will fail on some of the unofficial test cases:
Why it does fail on the "very long text" is a riddle to me, maybe because of the single character surrounded by single punctuation ... only God knows On the other side I have code that works with the official test cases and is shorter:
This dies miserably on array reference out of bound if Blocksize >= 10 It's getting chaotic, no? Wait, there's more ... My ammended code passes the official results as well, is safe for Blocksize >= 10, but has a severe problem with numbers as 'punctuation':
The green is getting muddy, it's nearly bed time, I haven't got a change to provide a working solution as the rules aren't clear, I plead for getting it straight and add another 24 hrs to the private round btw. You guys are insane ... How do you do this? |
||||||||
|
|
|||||||
just typing something and executing. most of the times it fails, rarely it produces a working result. you should try |
||||||||
|
|
|||||||
I have to apologize for not getting back to you guys earlier. The days at work are a bit hectic right now and I just finished a 14 hour shift :-( Anyway, as my instructions were a bit unclear and caused confusion I am therefore decreeing the following: 1) Characters are only the characters within the range of A-Z and a-z, thus ASCII codes 65-90 and 97-122. Any other character is thus classified as punctuation and should be left in their original positions. This includes numbers, special charattcers that some languages are using and any other symbol, etc. 2) I'm adding some of DrillSergeant's test cases to the package (but not 7 or 10). I added a test case 11, which is a modification from test case 1 with the spaces replace by numeric characters. As this should not change the encoded message it's a quick way to test for numerics. 3) I'll extend the private round until Thursday 6pm EST to give everybody a chance to digest the decrees. I believe that with these clarifications nobody is being put at an disadvanges, though the Europeans may have a head-start now. |
||||||||
|
|
|||||||
Originally Posted By: Sealeopard 3) I'll extend the private round until Thursday 6pm EST to give everybody a chance to digest the decrees. Thank you Jens, I half feared that though ... Oh, my poor head |
||||||||
|
|
|||||||
And again I have to retract my scores posted so far as my 426 code fails test case #6 |
||||||||
|
|
|||||||
damn! for once I was leading and now 2 extra days!?!? come on! now I feel abandoned! |
||||||||
|
|
|||||||
this is more fun then to watch tv. I think I need to take vacation and try this myself :). |
||||||||
|
|
|||||||
k, here is my NEW score using the latest official test cases, please disregard all previous score postings Quote: Running Test 1 Encoding...Decoding...Done The bug I produced for blocksize = 10 was a real noobish fault ... I'd bite my rear if only I could reach it |
||||||||
|
|
|||||||
Originally Posted By: Jooel just typing something and executing. most of the times it fails, rarely it produces a working result. you should try ehmmmm ... ja ... LOL |
||||||||
|
|
|||||||
btw, my 439 score, for good measure, passes as well the 10 test cases Rogier provided... I don't dare to say it is 100% water proof as there might be a yet unknown evil ascii cahracter that will eventually break it |
||||||||
|
|
|||||||
stripping it down to: Quote: 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 Running Test 8 Encoding...Decoding...Done Running Test 9 Encoding...Decoding...Done Running Test 11 Encoding...Decoding...Done Your solution passed all tests KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows 2000 Professional CPU = Intel(R) Pentium(R) 4 CPU 2.80GHz Speed = 2793 MHz Memory = 504 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/09 11:09:18.156 Processing End = 2007/08/09 11:09:18.187 Duration = 0000/00/00 00:00:00.030 KiXGolf Score = 435 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
please delete |
||||||||
|
|
|||||||
please delete |
||||||||
|
|
|||||||
please delete |
||||||||
|
|
|||||||
OMG, I accidentally erased the decoding part out of the calling script whilst adding screen output for failed tests. I will download a fresh copy and edit all previous post with too less scores ... Sorry |
||||||||
|
|
|||||||
Right, with a fresh copy of kixgolf_ts.kix my scores are now: 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 Running Test 8 Encoding...Decoding...Done Running Test 9 Encoding...Decoding...Done Running Test 11 Encoding...Decoding...Done Your solution passed all tests KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows 2000 Professional CPU = Intel(R) Pentium(R) 4 CPU 2.80GHz Speed = 2793 MHz Memory = 504 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/09 13:46:41.546 Processing End = 2007/08/09 13:46:41.578 Duration = 0000/00/00 00:00:00.031 KiXGolf Score = 429 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
Whoops, I forgot ... 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 Running Test 8 Encoding...Decoding...Done Running Test 9 Encoding...Decoding...Done Running Test 11 Encoding...Decoding...Done Your solution passed all tests KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows 2000 Professional CPU = Intel(R) Pentium(R) 4 CPU 2.80GHz Speed = 2793 MHz Memory = 504 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/09 13:51:23.312 Processing End = 2007/08/09 13:51:23.359 Duration = 0000/00/00 00:00:00.046 KiXGolf Score = 426 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
Crap. Only letters (A-Z and a-z) will add to my code. |
||||||||
|
|
|||||||
must...lose...two...more...
|
||||||||
|
|
|||||||
hehe... dude, I like you using the pre. looks lot nicer. I modded the kixgolf_ts.kix: Code: ; KiXtart Golf ; ; break on ; standard KiXgolf variables dim $sGolfScoreUDF, $bGolfScore, $sKiXgolfUDF, $sOutputFile dim $sTitle, $iRC, $sKiXGolfScrEngVer, $sKiXformsVer, $objKiXforms dim $sStartTimeDate, $sEndTimeDate, $sRunTime dim $iKiXGolfScore, $sOutput, $sResult,$outputResult dim $sKiXGolfINI, $asTests, $iTests, $iValid, $sTest, $sInput, $sOutput, $sResult, $iBlockSize,$sPermutation ; set required options $sTitle='Top Secret' $iRC=SETTITLE('KiXtart Golf: '+$sTitle) $iRC=SETOPTION('Explicit','on') $iRC=SETOPTION('NoVarsInStrings','on') $iRC=SETOPTION('NoMacrosInStrings','on') $iRC=SETOPTION('WrapAtEOL','on') $iRC=SETOPTION('CaseSensitivity','on') cls $sGolfScoreUDF=@scriptdir+'\'+'kixgolf3.3.udf' if exist($sGolfScoreUDF) call $sGolfScoreUDF $bGolfScore=1 else ? 'Unable to find the KiXgolf Scoring Engine, exiting script' exit 2 endif $sKiXGolfScrEngVer = '3.3' ; this is the actual KiXgolf UDF $sKiXGolfUDF=@scriptdir+'\'+join(split(ucase(@scriptname),'.KIX'),'.udf') if exist($sKiXGolfUDF) call $sKiXGolfUDF else ? 'KiXgolf UDF not present!' exit 2 endif ; initialize official KiXtart Golf Score results file $sOutputFile=@scriptdir+'\'+join(split(ucase(@scriptname),'.KIX'),'.txt') ; this is the start of the main loop $sStartTimeDate=@DATE+' '+@TIME+'.'+right('000'+@MSECS,3) $sKiXGolfINI=@scriptdir+'\'+join(split(ucase(@scriptname),'.KIX'),'.ini') $asTests=split(readprofilestring($sKiXgolfINI,'',''),chr(10)) if $asTests[ubound($asTests)]='' redim preserve $asTests[ubound($asTests)-1] endif $iTests=(ubound($asTests)+1)*2 $iValid=0 for each $sTest in $asTests ? 'Running '+$sTest+' Encoding...' $iBlocksize=int(readprofilestring($sKiXgolfINI,$sTest,'Blocksize')) $sPermutation=readprofilestring($sKiXgolfINI,$sTest,'Permutation') $sInput=readprofilestring($sKiXgolfINI,$sTest,'Input') $sOutput=readprofilestring($sKiXgolfINI,$sTest,'Output') ; testing the encoding of a message $sResult=a($iBlocksize,$sPermutation,$sInput,'E') if $sOutput==$sResult $iValid=$iValid+1 else ? "failed: '" $sOutput "' =! '" $sResult "'"? endif 'Decoding...' ; testing the decoding of a message $sResult=a($iBlocksize,$sPermutation,$sResult,'D') if $sInput==$sResult $iValid=$iValid+1 else ? "failed: " $sInput " =! " $sResult ? endif 'Done' next ; this is the end of the main loop $sEndTimeDate=@DATE+' '+@TIME+'.'+right('000'+@MSECS,3) $sRunTime=datetimediff($sStartTimeDate, $sEndTimeDate) ; this is the end of main loop if $iValid=$iTests $outputResult='Solution passed all '+$iTests+' tests' else $outputResult='Solution failed '+($iTests-$iValid)+' of '+$iTests+' tests.' endif ; generate KiXtart Golf Score $iKiXGolfScore=KiXGolf($sKiXGolfUDF) ; generating official KiXGolf Score $sOutput='' $sOutput=$sOutput+@CRLF+'KiXtart' $sOutput=$sOutput+@CRLF+'KiXtart Version = '+@KIX $sOutput=$sOutput+@CRLF+'KiXGolf Script = '+@SCRIPTNAME $sOutput=$sOutput+@CRLF+'' $sOutput=$sOutput+@CRLF+'Computer' $sOutput=$sOutput+@CRLF+'OS = '+@PRODUCTTYPE $sOutput=$sOutput+@CRLF+'CPU = '+@CPU $sOutput=$sOutput+@CRLF+'Speed = '+@MHZ+' MHz' $sOutput=$sOutput+@CRLF+'Memory = '+(round(cdbl(MEMORYSIZE(0))/2)*2)+' MB' $sOutput=$sOutput+@CRLF+'' $sOutput=$sOutput+@CRLF+'KiXGolf Scoring Engine' $sOutput=$sOutput+@CRLF+'Scoring Engine = '+$sKiXGolfScrEngVer $sOutput=$sOutput+@CRLF+'' $sOutput=$sOutput+@CRLF+'KiXtart Golf Score' $sOutput=$sOutput+@CRLF+'Tournament = '+$sTitle $sOutput=$sOutput+@CRLF+'Processing Start = '+$sStartTimeDate $sOutput=$sOutput+@CRLF+'Processing End = '+$sEndTimeDate $sOutput=$sOutput+@CRLF+'Duration = '+$sRunTime $sOutput=$sOutput+@CRLF+'KiXGolf Result = '+$outputResult $sOutput=$sOutput+@CRLF+'KiXGolf Score = <font color="red">'+$iKiXGolfScore+'</font>' $sOutput=$sOutput+@CRLF+' ' $sOutput=$sOutput+@CRLF+'Thank you for participating in KiXtart Golf!' ; saving and displaying official KiXtart Golf Score $iRC=redirectoutput($sOutputFile,1) '<br><br><pre style="background:white;border-style:solid;border-color:silver;">' ? $sOutput+@CRLF+'</pre><br><br>' $iRC=redirectoutput('') ? $sOutput ; display score when using WKIX32 if @SCRIPTEXE='WKIX32.EXE' ? 'Press any key to continue...' ? 'Remember to post your scrore!' get $iRC run 'notepad '+$sOutputFile endif exit 0 ; any modifications below this line will result in immediate disqualification ;support UDFs for date/time calculations ;FUNCTION DateTimeDiff ; ;ACTION Calculates the time difference between two date-times-groups ; ;AUTHOR Jens Meyer (sealeopard@usa.net) ; ;VERSION 1.1 ; ;KIXTART 4.20 ; ;SYNTAX DATETIMEDIFF(DTG1 [,DTG2]) ; ;PARAMETYERS DTG1 ; Required string as a date-time-group (DTG) in one of the following formats: ; "YYYY/MM/DD HH:MM[:SS.MSECS]" ; "YYYY/MM/DD" which assumes that HH:MM[:SS.MSECS] = 00:00:00.000 ; "HH:MM[:SS.MSECS]" which assumes that "YYY/MM/DD" = @DATE ; ; DTG2 ; Optional string as date-time-group (DTG) in one of the following formats: ; "YYYY/MM/DD HH:MM[:SS.MSECS]" ; "YYYY/MM/DD" which assumes that HH:MM[:SS.MSECS] = @TIME ; "HH:MM[:SS.MSECS]" which assumes that "YYY/MM/DD" = @DATE ; DTG2 will default to the current date and time if not provided in the form of ; @DATE+' ' +@TIME+'.'+@MSECS ; ; ; ;RETURNS Returns difference DTG2-DTG1 as "YYYY/MM/DD HH:MM[:SS.MSECS]" ; ;REMARKS none ; ;DEPENDENCIES SERIALTIME() @ http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000039 ; SERIALDATE() @ http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000089 ; ;EXAMPLE $rc=DATETIMEDIFF('23:20:33','01:01:01.245') ; ;KIXTART BBS http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000374 ; function datetimediff($time1,$time2) Dim $date1, $date2, $datediff, $timediff $datetimediff='' if not instr($time1,' ') select case instr($time1,'/') $time1=$time1+' 00:00:00.000' case instr($time1,':') $time1=@DATE+' '+$time1 case 1 exit 87 endselect endif if not instr($time2,' ') select case instr($time2,'/') $time2=$time2+' '+@TIME+'.'+right('000'+@MSECS,3) case instr($time2,':') $time2=@DATE+' '+$time2 case 1 $time2=@DATE+' '+@TIME+'.'+right('000'+@MSECS,3) endselect endif $time1=split($time1,' ') $date1=$time1[0] $time1=$time1[1] $time2=split($time2,' ') $date2=$time2[0] $time2=$time2[1] $datediff=serialdate($date2)-serialdate($date1) $timediff=serialtime($time2)-serialtime($time1) if $timediff=>86400 $timediff=$timediff-86400 $datediff=$datediff+1 endif $datediff=serialdate(serialdate('0000/00/00')+$datediff-1) $timediff=serialtime($timediff) $datetimediff=$datediff+' '+$timediff exit 0 endfunction ;FUNCTION SerialDate ; ;ACTION Convert dates to numbers (and back) for the purpose of performing date math ; ;AUTHOR ScriptLogic (http://www.scriptlogic.com) ; ;CONTRIBUTOR Jens Meyer (sealeopard@usa.net) ; ;VERSION 1.1 ; ;SYNTAX SERIALDATE(DATE) ; ;PARAMETERS DATE or NUMBER ; if a date is used, it must be in the form of "YYYY/MM/DD" ; if a number is used, it must be a number previously derived from this function. ; ;RETURNS If a date is passed to this function, the function returns a number. If a number is ; passed to this function, a date "YYYY/MM/DD" is returned ; ;REMARKS This function was developed as a core routine for the DateMath( ) function. In ; normal usage, you would most like just use the DateMath( ) function which depends ; on this function. ; Algorithms used in the development of this routine were obtained from: ; http://www.capecod.net/~pbaum/date/date0.htm ; ; Fixed a couple of inconsistencies in the returned values and formatting ; ;DEPENDENCIES none ; ;EXAMPLE $rc=serialdate('2001/07/01') ; ;KIXTART BBS http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000089 ; function serialdate($ExpD) dim $z,$h,$a,$b,$c,$y,$m,$d if instr($ExpD,'/') $ExpD=split($ExpD,'/') $y=val($ExpD[0]) $m=val($ExpD[1]) $d=val($ExpD[2]) if $m<3 $m=$m+12 $y=$y-1 endif $SerialDate=$d+(153*$m-457)/5+365*$y+$y/4-$y/100+$y/400-306 else $z=0+$ExpD+306 $h=100*$z-25 $a=$h/3652425 $b=$a-$a/4 $y=(100*$b+$h)/36525 $c=$b+$z-365*$y-$y/4 $m=(5*$c+456)/153 $d=$c-(153*$m-457)/5 if $m>12 $y=$y+1 $m=$m-12 endif $SerialDate=right('0000'+$y,4)+'/'+right('00'+$m,2)+'/'+right('00'+$d,2) endif endfunction ;FUNCTION SerialTime ; ;AUTHOR Jens Meyer (sealeopard@usa.net) ; ;ACTION Convert time to numbers (and back) for the purpose of performing time math ; ;VERSION 1.1 ; ;KIXTART 4.20 ; ;SYNTAX SERIALTIME(STRTIME) ; ;PARAMETERS STRTIME ; Reqired string containing either a time "HH:MM[:SS.MSECS]" or an integer greater ; than zero and less than 86400 representing seconds and fractions ; e.g 20.040 for 20 seconds and 40 milliseconds ; ;RETURNS If supplied a time, returns seconds since midnight. If supplied seconds since ; midnight, returns time. ; ;REMARKS Reworked function based on the ScriptLogic UDF but without dependencies and adapted for milliseconds ; The original ScriptLogic UDF at ; http://www.scriptlogic.com/kixtart/FunctionLibrary_ViewFunction.aspx?ID=SerialTime ; cannot manage milliseconds and relies on three dependencies. ; ;DEPENDENCIES none ; ;EXAMPLE $rc=SERIALTIME('02:20:33.187') ; ;KIXTART BBS http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000039 ; function serialtime($strtime) dim $hours, $minutes, $seconds, $milliseconds if instr($strtime,':') $strtime=split($strtime,':') select case ubound($strtime)<3 redim preserve $strtime[3] if instr($strtime[2],'.') $strtime[3]=right($strtime[2],len($strtime[2])-instr($strtime[2],'.')) $strtime[2]=left($strtime[2],instr($strtime[2],'.')-1) else $strtime[3]=0 endif case ubound($strtime)>3 $serialtime=-1 exit 87 endselect $hours=val($strtime[0]) if $hours<0 or $hours>23 $serialtime=-1 exit 87 endif $minutes=val($strtime[1]) if $minutes<0 or $minutes>59 $serialtime=-1 exit 87 endif $seconds=val($strtime[2]) if $seconds<0 or $seconds>59 $serialtime=-1 exit 87 endif $milliseconds=cdbl($strtime[3]) if $milliseconds<0 or $milliseconds>999 $serialtime=-1 exit 87 endif $serialtime=0.0+($hours*3600)+($minutes*60)+($seconds)+($milliseconds/1000) else $strtime=val(cdbl($strtime)*1000) if $strtime<=86400000 and $strtime>=0 $hours=$strtime/3600/1000 $strtime=$strtime-($hours*3600*1000) $hours=right('00'+$hours,2) $minutes=$strtime/60/1000 $strtime=$strtime-($minutes*60*1000) $minutes=right('00'+$minutes,2) $seconds=$strtime/1000 $strtime=$strtime-($seconds*1000) $seconds=right('00'+$seconds,2) $milliseconds=left($strtime,3) $milliseconds=right('000'+$milliseconds,3) $serialtime=$hours+':'+$minutes+':'+$seconds+'.'+$milliseconds else $serialtime='-1' exit 87 endif endif endfunction ; this is a replacement for the formatnumber() function that seems to be buggy function numberformat($number,$digits) dim $comma $comma=READVALUE('HKEY_CURRENT_USER\Control Panel\International','sDecimal') $digits=val($digits) if $digits<0 $digits=0 endif $number=''+round(cdbl($number),$digits) if not instr($number,$comma) $number=$number+$comma endif $number=split($number,$comma) if $digits=0 $numberformat=$number[0] return endif while len($number[1])<$digits $number[1]=$number[1]+'0' loop $number=join($number,$comma) $numberformat=$number endfunction ;FUNCTION ATrim ; ;ACTION Strips leading and trailing spaces from an input string or array and returns the result ; ;AUTHOR Jens Meyer (sealeopard@usa.net) ; ;VERSION 1.3 ; ;KIXTART 4.20 ; ;SYNTAX ATRIM(STRING) ; ;PARAMETERS STRING ; Required string or array from which to strip leading and trailing spaces ; ;RETURNS Input string/array without leading and trailing spaces ; ;REMARKS Function converts an array with a maximum of 26 dimensions ; ;DEPENDENCIES none ; ;EXAMPLE $array[0]=' String1' ; $array[1]=' String2 ' ; $rc=atrim($array) ; ;KIXTART BBS http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000031 ; function atrim($array) Dim $element, $maxelements, $arraydim, $rc, $a select case ubound($array,1)=-1 $array=trim($array) case ubound($array,2)=-1 $maxelements=val(ubound($array)) for $element=0 to $maxelements $array[$element]=trim($array[$element]) next case ubound($array,27)=-1 $arraydim=0 do $arraydim=$arraydim+1 until ubound($array,$arraydim)=-1 $arraydim=$arraydim-1 if $arraydim<=26 dim $cmd, $vars $vars='$sub_a' for $a=2 to $arraydim $vars=$vars+', $sub_'+chr($a+96) next $cmd='dim '+$vars+@CRLF for $a=1 to $arraydim $cmd=$cmd+'for $sub_'+chr($a+96)+'=0 to ubound($array,'+$a+')'+@CRLF next $cmd=$cmd+'$array['+$vars+']=trim($array['+$vars+'])'+@CRLF for $a=1 to $arraydim $cmd=$cmd+'next'+@CRLF next $rc=execute($cmd) endif case 1 endselect $atrim=$array endfunction to note, when there is a failure, I think showing the failure is crucial, that's why there is print line on the check part. with wkix32.exe, displaying the result could be totally supressed, if there are no errors, just splash the notepad open. |
||||||||
|
|
|||||||
damn, you guys working on the script while I'm strucling with virtual servers here. hoby, dude, I wanna see your code if that's the case! |
||||||||
|
|
|||||||
k, it took just about 12 hours of work to rest my brain enough to come up with: KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_ts.kix Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 797 MHz Memory = 1014 MB KiXGolf Scoring Engine Scoring Engine = 3.3 KiXtart Golf Score Tournament = Top Secret Processing Start = 2007/08/09 22:56:23.781 Processing End = 2007/08/09 22:56:24.375 Duration = 0000/00/00 00:00:00.593 KiXGolf Result = Solution passed all 20 tests KiXGolf Score = 354 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
Not the best score, but it passes all tests and I like it.
Ok why does my text not look right? HTML is not interpretted. |
||||||||
|
|
|||||||
Originally Posted By: Jooel hehe... dude, I like you using the pre. looks lot nicer. I copied that from one of yours Allright, as I just came home from an afterwork thing and feel too tired to fire up my Ultraedit still having over 60 strokes to cut I rest my case with a score of 426 If Howard and SixDoubleO can't get past that it'll make a nice third place which would be the best result ever for me |
||||||||
|
|
|||||||
yup. there is a bug in the quick reply. trying to fix it just now. |
||||||||
|
|
|||||||
Howard you have to choose either HTML or HTML and UBB formating before posting ... you can't edit to html formatted though ... wait a minute ... Only 7 strokes behind ??? |
||||||||
|
|
|||||||
hoby propably used quickreply and it has no selection for markuptype. it should, but there is the bug. k, I tried to make it "both" if available. so... Code: this is code-tag and this is pre-tag |
||||||||
|
|
|||||||
damn, it worked. |
||||||||
|
|
|||||||
doesn't work for editpost though. sadly. |
||||||||
|
|
|||||||
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/09 17:09:56.780 Processing End = 2007/08/09 17:09:56.820 Duration = 0000/00/00 00:00:00.040 KiXGolf Result = Solution passed all 18 tests KiXGolf Score = 429 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
just few more to go. |
||||||||
|
|
|||||||
Sorry Jochen, KiXtart KiXtart Version = 4.60 Beta 1 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/09 18:14:13.322 Processing End = 2007/08/09 18:14:13.362 Duration = 0000/00/00 00:00:00.039 KiXGolf Result = Solution passed all 18 tests KiXGolf Score = 425 Thank you for participating in KiXtart Golf! |
||||||||
|
|
|||||||
Why is there a Blocksize when the permutation shows what the blocksize is? i.e. Permutation=3,1,4,2 The blocksize is 4. I think the blocksize parameter is redundant |
||||||||
|
|
|||||||
yep, it is. but, there is lot of redundant stuff going on your machine all the time. doesn't hurt. |
||||||||
|
|
|||||||
also tested my code by ignoring $block_length and using that var for other purposes. got 360. so, even though it's just an extra var basically, it still shortens the script a bit. |
||||||||
|
|
|||||||
Witto... it's funny, I asked that and the what was considered punctuation first thing... but it took 5 days for it to cycle around again. http://www.kixtart.org/forums/ubbthreads...true#Post178707 http://www.kixtart.org/forums/ubbthreads...true#Post178699 |
||||||||
|
|
|||||||
The private coding round is now closed. Please post your final scores and corresponding scripts in the new public thread. |