#164822 - 2006-07-23 09:29 AM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
Quote:
Cappy, that $ = right($,~) thing ... had to actually run it to figure it out. Its a shorter form of $ = right($,-1). Seems like this:
$ = right("cappy",~)
would return "appy"
That is brilliant.
Yes, brilliant. I havn't run it, but still, after you pointed it out, how could one possibly figure that out without having the kixtart source code? Rogier, what the green heck did you do to find that one, asked Ruud??
Well, my deep respect to all of you. I started thinking of reducing the mayan string array thing last week, but that was only wishful thinking for me
_________________________
|
Top
|
|
|
|
#164823 - 2006-07-23 11:03 AM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
Loc: CA
|
From the manual.
Code:
~ Performs a bit-wise mathematical negation (NOT) operation on a number.
|
Top
|
|
|
|
#164824 - 2006-07-23 11:22 AM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
Top
|
|
|
|
#164825 - 2006-07-23 11:33 AM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
KiXGolf Score = 178
Code:
Function m($)
dim $a,$b,$c
for $b = 1 to 15 $c = split("- . : .: :: | " + $a) $a = $a + $c[$b] + "| " next
for each $a in split($) $m = $m * 20 + ascan($c,$a) if $+0=$ $m = $c[$ mod 20] if $/20 $m = m($/20) + " " + $m ;endif ;endif ;next
EndFunction
|
Top
|
|
|
|
#164829 - 2006-07-23 02:28 PM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
KiXGolf Score = 177
Code:
Function m($)
dim $a,$b,$c
for $b = 1 to 15 $c = split("- . : .: :: | " + $a) $a = $a + $c[$b] + "| " next
for each $a in split($) $m = $m * 20 + ascan($c,$a) if $m<0 $m = $c[$ mod 20] if $/20 $m = m($/20) + " " + $m ;endif ;endif ;next
EndFunction
|
Top
|
|
|
|
#164832 - 2006-07-23 06:07 PM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
sorry boys. the bachelor party went on a bit longer than they normally do. I'm not fit to code anything yet but let me find the codes for you...
the 182 code: Code:
Function m($i) dim $e, $, $n if $i=0+$i do $ = $i mod 20 do $n = 3*($>4) + ($>1) + ($>) $e = substr('-.:__|',1+$n,1) + $e $ = $ - $n until $=0 $m = $e + $m $e = " " $i = $i/20 until $i=0 else $m=-1 do $m=$m+1 until $i=m($m) EndFunction
and the 219: Code:
Function m($) dim $e, $i, $n if $=0+$ do $i = $ mod 20 $m = split(" . : .: :: -")[iif($i=0,5,$i mod 5)] + left('|||',$i/5) + $e + $m $e = ' ' $ = $/20 until $=0 else $i=split($) $=1 for $n=-ubound($i) to 0 for $e=0 to 19 if $i[-$n]=m($e) $m = $m + $ * $e $ = $ * 20 EndFunction
and shawn, no matter how much you protest, the rules are clear. as long as the code executes in the alloted time, it is fine. this is not the first golf round when these type of codes are used. in fact, way back on one golf round the tests were altered by individuals so these type of codes didn't suffer so much time penalty.
|
Top
|
|
|
|
#164833 - 2006-07-23 06:12 PM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
and here is 176 code. 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] if $_/20 $m = m($_/20) + " " + $m EndFunction
|
Top
|
|
|
|
#164835 - 2006-07-23 07:26 PM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
Ok - here's some 173 code:
Code:
Function m($)
dim $a, $b, $c
for $b = 1 to 15 $c = split("- . : .: :: | " + $a) $a = $a + $c[$b] + "| " next
if $=0+$ $m = $c[$ mod 20] if $/20 $m = m($/20) + " " + $m endif else $m=-1 do $m=$m+1 until $=m($m) EndFunction
|
Top
|
|
|
|
#164836 - 2006-07-23 07:52 PM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
I'm posting this 173 on behalf of Rogier (DrillSergeant) ...
Code:
;! Function m($)
dim $a
if $=0+$ do $a = $ mod 20 $m = trim(iif($a,left('.',$ mod 5 mod 2)+left('::',$ mod 5/2)+left('|||',$a/5),'-')+' '+$m) $ = $ / 20 until $ = 0 else $m=-1 do $m=$m+1 until $=m($m) EndFunction ;!
|
Top
|
|
|
|
#164838 - 2006-07-23 08:03 PM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
This is 167
This one I am submitting on behalf of me, Rogier and Benny ... especially Benny because he found the reduction ...
Code:
Function m($)
if $=0+$ do ;$a = $ mod 20 $m = trim(iif($ mod 20,left('.',$ mod 5 mod 2)+left('::',$ mod 5/2)+left('|||',$ mod 20/5),'-')+' '+$m) $ = $ / 20 until $ = 0 else $m=-1 do $m=$m+1 until $=m($m) EndFunction
|
Top
|
|
|
|
#164840 - 2006-07-23 08:18 PM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
Quote:
did you either one test the codes?
Is that in the rules ?
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 628 anonymous users online.
|
|
|