#164963 - 2006-07-27 11:50 PM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
k, it's back in. 295 Code:
Function m($i)
Dim $a,$b,$c,$ If $i=$i+0 $a="|",":","." $b=5,2,1 Do $ = $i mod 20 If $=0 $m="-"+$m Endif For $c = 0 to 2 While $/$b[$c] $m=$a[$c]+$m $=$-$b[$c] Loop Next
$i = $i/20 If $i $m = " " + $m EndIf Until $i=0 Else For Each $c in Split($i) $=0 For $b = 1 to Len($c) $a=SubStr($c,$b,1) $=$+($a=".")+($a=":")*2+($a="|")*5 Next $m=$m*20+$ EndFunction
|
Top
|
|
|
|
#164965 - 2006-07-27 11:54 PM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
hehee, i keep posting and you beat me to a better post
|
Top
|
|
|
|
#164969 - 2006-07-28 12:53 AM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
hmm... this starts to look little like my udf anyways... 264 evolution: Code:
Function m($)
Dim $a,$b,$d $a=".:__|" If $=$+0 Do $d = $ mod 20 If $d=0 $m="-"+$m Endif $b=5 while $b While $d/$b $m=substr($a,$b,1)+$m $d=$d-$b Loop $b=$b/2 loop
$ = $/20 If $ $m = " " + $m EndIf Until $=0 Else For Each $ in Split($) $d=0 For $b = 1 to Len($) $d=$d+instr($a,SubStr($,$b,1)) Next $m=$m*20+$d EndFunction
|
Top
|
|
|
|
#164971 - 2006-07-28 01:05 AM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
Ok - I jumped at the easy recurse ...
Benny-259
Code:
Function m($)
Dim $a,$b,$d $a=".:__|" If $=$+0 $d = $ mod 20 If $d=0 $m="-"+$m Endif $b=5 while $b While $d/$b $m=substr($a,$b,1)+$m $d=$d-$b Loop $b=$b/2 loop
$ = $/20 If $ $m = m($) + " " + $m EndIf Else For Each $ in Split($) $d=0 For $b = 1 to Len($) $d=$d+instr($a,SubStr($,$b,1)) Next $m=$m*20+$d EndFunction
|
Top
|
|
|
|
#164972 - 2006-07-28 07:39 AM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
just for 5 strokes?
|
Top
|
|
|
|
#164973 - 2006-07-28 07:51 AM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
227 then. Code:
Function m($b)
Dim $a,$,$d $a=".:__|" If $b=$b+0 $ = $b mod 20 If $=0 $m="-"+$m Endif $d=5 while $d While $/$d $m=substr($a,$d,1)+$m $=$-$d Loop $d=$d/2 loop $ = $b/20 If $ $m =m($) + " " + $m EndIf Else For Each $ in Split($b) For $b = 0 to 19 if m($b) = $ $m=$m*20+$b EndFunction
|
Top
|
|
|
|
#164974 - 2006-07-28 08:16 AM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Gargoyle
MM club member
Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
|
Only one comment here.... Jooel - Shawn.... do you each have stock...
|
Top
|
|
|
|
#164977 - 2006-07-30 09:59 PM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
here is one idea I was playing with but it backfired and came up with 172: Code:
Function m($!) dim $,$b
for $ = 1 to 19 $b = split('- . : .: :: ' + $m) $m = $m + '| ' + $b[$] next
for each $! in split($!) $m = $*$m + ascan($b,$!) if 0>$m $m = $b[$! mod $] $ = 1*$!/$ if $ $m = m($) + ' ' + $m EndFunction
|
Top
|
|
|
|
#164978 - 2006-07-31 12:28 AM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
ja, and I was going down this path - same result:
Code:
if 19<$ $m = m($b/20) + " " + $m
|
Top
|
|
|
|
#164979 - 2006-07-31 01:37 AM
Re: KiXgolf: Mayan Number Converter - Public Phase
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
not same result. with that you get 170. I also had a variation of 171. but that's the only one I found that doesn't increase the amount of strokes. but it doesn't lessen them either
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 868 anonymous users online.
|
|
|