#164841 - 2006-07-23 09:39 PM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
sure it is.
Quote:
All provided test cases representing valid Mayan Numbers must be correctly solved in order to have the KiXgolf score count.
your 173, rogiers 173 and your collective 167 all fail that part as you didn't run the test cases. thus, my 176 still holds.
|
Top
|
|
|
|
#164845 - 2006-07-24 04:40 AM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Sealeopard
KiX Master
Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
|
Regarding the brute-force approach, this rule pretty much covers it:
Quote:
The UDF is expected to finish in a reasonable time, e.g. if it gets started when the challenge opens, it's expected to be finished by the time the challenge closes even on a somewhat slow computer. The UDF has to be valid during the period that the challenge runs.
plus I have the ultimate say:
Quote:
6) In case of questions about a particular way to count the KiXtart Golf Challenge organizer has the last call.
We do have a precedence where we allowed a brute-force approach in the CD Sorter challenge.
However, I am currently running Jooel's initial solution. On a rather fast computer (AMD Athlon 64 X2 3800+), the brute-force approach requires on average 2 seconds to rotate through 10.000 numbers. This highest number I have in my private test cases is ::||| ::||| ::||| ::||| ::||| ::||| ::|||=1279999999. This number alone will require three days to compute. Thus, I believe that this violates the "reasonable time" rule as throwing in a single additional test, e.g. 1279999998 case will make the brute-force approach run well after the conclusion of the public round.
Therefore the brute-force approaches, while a creative demonstration, will not qualify for valid KiXgolf scores under the "reasonable time" rule.
Regarding changing the parameters inside the FUNCTION line, there is no rule covering this. I am tending to continue allowiing this as there might be a tournament where one want to add an addtional OPTIONAL parameter into the function call in order to implement some kind of recrsive solution. There is a precedence where I changed the names of the parameters inside the FUNCTION mid-tournament in order to not penalize a recursive solution, thus it's kind-of a precedent.
After the conclusion of this tournament, I will post the updated rules for discussion.
Edited by sealeopard (2006-07-24 04:42 AM)
_________________________
There are two types of vessels, submarines and targets.
|
Top
|
|
|
|
#164846 - 2006-07-24 07:48 AM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
Loc: CA
|
Quote:
6) In case of questions about a particular way to count the KiXtart Golf Challenge organizer has the last call.
Well I guess that sums it up rather easy.
Okay, given a bit of a history lesson I'll agree with you on this one Jooel. However being that this was the first one where I even really attempted it and the Function($) EndFunction was supplied I did not think that one could or should modify it. However since Jens sees fit to do so that's fine as well, but it should be clearly listed as a possible option in the rules for future games.
|
Top
|
|
|
|
#164849 - 2006-07-24 08:56 AM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
DrillSergeant
MM club member
Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
|
Now, now, boys, play nice
First of all, I took benny's 216 and I got one stroke down with the Jooel-trick to define the space after the first mayan number and adding that for the rest. So I got a 215 now. Code:
; begin Mayan Number Converter ; ;! Function m($) dim $a If $+0=$ Do $m = iif($ mod 20, left('.',$ mod 5 mod 2)+ left('::',$ mod 5/2)+left('|||',$ mod 20/5),'-')+$a+$m $a = ' ' $ = $ / 20 Until $ = 0 Else While $ $a = instr('-.:__|', left($,1)) $m = iif($a, $m+$a-1, $m*20) $ = right($,~) EndFunction ;! ;! ; end Mayan Number Converter
Code:
Mayan Number Converter passed all 60 tests (100% correct)
KiXtart KiXtart Version = 4.52 Release Candidate 2 KiXGolf Script = kixgolf_Mnc.kix
Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 1595 MHz Memory = 478 MB
KiXGolf Scoring Engine Scoring Engine = 3.0.3
KiXtart Golf Score Tournament = KiXtart Golf: Mayan Number Converter Processing Start = 2006/07/24 08:38:06.541 Processing End = 2006/07/24 08:38:06.551 Duration = 0000/00/00 00:00:00.009 KiXGolf Score = 215 Thank you for participating in KiXtart Golf!
I think I took the ~ trick from a former golf course I've read, or else I've been playing around with all binary operators to see how they would react to different numbers.
The double mod is a result of golfing down the original code. slashing out variables where-ever I could. If I have time I'll rebuilt the code back to the basics so that it's easier to understand.
Brute force? For me, that's a bit icky. Besides, it's a coding contest...
Change variables? I've looked into that too, but it wouldn't have improved my score, or else I would have done it too.
Recursive function? Damn... should have thought of that too!
Jens, looking at the setup and preparation for this, I'm guessing you've spend a lot of work on it.
If there wasn't a perfect test-environment and everything, I prolly wouldn't have even teed off. So in my book, you own the sandbox, and you can change the rules however you seem fit. Thank you for this nice round, and I'm very much looking forward to the next one.
|
Top
|
|
|
|
#164850 - 2006-07-24 09:21 AM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
DrillSergeant
MM club member
Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
|
update: Benny pm-ed me a beauty of a 211, and with the trick above it's a 210. So this is a Benny/Sarge score Code:
Function m($) Dim $a If $+0=$ Do $m = Split(" . : .: :: -")[IIf($ mod 20=0,5,$ mod 20 mod 5)] + Left('|||',$ mod 20/5)+$a+$m $a = ' ' $ = $ / 20 Until $ = 0 Else While $ $a = InStr('-.:__|', Left($,1)) $m = IIf($a, $m+$a-1, $m*20) $ = Right($,~) EndFunction
|
Top
|
|
|
|
#164851 - 2006-07-24 09:23 AM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
DrillSergeant
MM club member
Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
|
changed: IIf($ mod 20=0,5,$ mod 20 mod 5) to
IIf($ mod 20, $ mod 20 mod 5,5)
[edit]I saw that benny's solution came looks a lot like Jooel's code, so it's[/edit]
for a 208 Benny/Jooel/Sarge score.
Code:
; begin Mayan Number Converter ; ;! Function m($) Dim $a If $+0=$ Do $m = Split(" . : .: :: -")[IIf($ mod 20,$ mod 20 mod 5,5)] + Left('|||',$ mod 20/5)+$a+$m $a = ' ' $ = $ / 20 Until $ = 0 Else While $ $a = InStr('-.:__|', Left($,1)) $m = IIf($a, $m+$a-1, $m*20) $ = Right($,~) EndFunction
;! ;! ; end Mayan Number Converter
Code:
Mayan Number Converter passed all 60 tests (100% correct)
KiXtart KiXtart Version = 4.52 Release Candidate 2 KiXGolf Script = kixgolf_mnc.kix
Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 1595 MHz Memory = 478 MB
KiXGolf Scoring Engine Scoring Engine = 3.0.3
KiXtart Golf Score Tournament = KiXtart Golf: Mayan Number Converter Processing Start = 2006/07/24 09:21:06.781 Processing End = 2006/07/24 09:21:06.791 Duration = 0000/00/00 00:00:00.009 KiXGolf Score = 208 Thank you for participating in KiXtart Golf!
Edited by DrillSergeant (2006-07-24 09:44 AM)
|
Top
|
|
|
|
#164852 - 2006-07-24 09:25 AM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
|
Top
|
|
|
|
#164853 - 2006-07-24 01:41 PM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
DrillSergeant
MM club member
Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
|
The need for the double mod got lost somewhere along the line. Since we don't need it anymore:
Code:
; begin Mayan Number Converter ; ;! Function m($) Dim $a If $+0=$ Do $m = iif($ mod 20, Split(' . : .: ::')[$ mod 5],'-') + Left('|||',$ mod 20/5)+$a+$m $a = ' ' $ = $ / 20 Until $ = 0 Else While $ $a = InStr('-.:__|', Left($,1)) $m = iif($a, $m+$a-1, $m*20) $ = Right($,~) EndFunction ;! ;! ; end Mayan Number Converter
for a result of: Code:
Mayan Number Converter passed all 60 tests (100% correct)
KiXtart KiXtart Version = 4.52 Release Candidate 2 KiXGolf Script = kixgolf_mnc.kix
Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 1595 MHz Memory = 478 MB
KiXGolf Scoring Engine Scoring Engine = 3.0.3
KiXtart Golf Score Tournament = KiXtart Golf: Mayan Number Converter Processing Start = 2006/07/24 13:39:21.692 Processing End = 2006/07/24 13:39:21.702 Duration = 0000/00/00 00:00:00.009 KiXGolf Score = 203 Thank you for participating in KiXtart Golf!
|
Top
|
|
|
|
#164855 - 2006-07-24 05:53 PM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
k, 175. Code:
Function m($_)
dim $,$b,$c
for $b = 1 to 15 $c = split("- . : .: :: | " + $) $ = $ + $c[$b] + "| " next
for each $ in split($_) $m = $m * 20 + ascan($c,$) if $m<0 $m = $c[$_ mod 20] $ = $_/20 if $ $m = m($) + " " + $m EndFunction
Code:
Mayan Number Converter passed all 60 tests (100% correct)
KiXtart KiXtart Version = 4.52 Release Candidate 1 KiXGolf Script = kixgolf_mnc.kix
Computer OS = Windows XP Professional CPU = Intel Pentium Model 13 Speed = 1866 MHz Memory = 760 MB
KiXGolf Scoring Engine Scoring Engine = 3.0.3
KiXtart Golf Score Tournament = KiXtart Golf: Mayan Number Converter Processing Start = 2006/07/24 18:52:45.171 Processing End = 2006/07/24 18:52:45.359 Duration = 0000/00/00 00:00:00.187 KiXGolf Score = 175
|
Top
|
|
|
|
#164856 - 2006-07-24 06:45 PM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
k 174
Code:
Function m($a)
dim $,$b,$c
for $b = 1 to 15 $c = split("- . : .: :: | " + $) $ = $ + $c[$b] + "| " next
for each $ in split($a) $m = $m * 20 + ascan($c,$) if $m<0 $m = $c[$ mod 20] $ = $a/20 if $ $m = m($) + " " + $m ;endif ;endif ;next
EndFunction
|
Top
|
|
|
|
#164858 - 2006-07-24 07:38 PM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 761 anonymous users online.
|
|
|