Page 10 of 11 « First<7891011>
Topic Options
#164961 - 2006-07-27 11:48 PM Re: KiXgolf: Mayan Number Converter - Public Phase
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
damn - i have to go for dinner - just when I was having the best time - catch up later.
Top
#164962 - 2006-07-27 11:49 PM Re: KiXgolf: Mayan Number Converter - Public Phase
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, same code, right?

oh, you mean the loosing of the for next?

Top
#164963 - 2006-07-27 11:50 PM Re: KiXgolf: Mayan Number Converter - Public Phase
Lonkero Administrator Offline
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
#164964 - 2006-07-27 11:52 PM Re: KiXgolf: Mayan Number Converter - Public Phase
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hey guys, stop deleting your damn posts.
Top
#164965 - 2006-07-27 11:54 PM Re: KiXgolf: Mayan Number Converter - Public Phase
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
hehee, i keep posting and you beat me to a better post
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#164966 - 2006-07-28 12:25 AM Re: KiXgolf: Mayan Number Converter - Public Phase
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
It started to look like Rogiers code there - with the Left() Right() thingy.
Top
#164967 - 2006-07-28 12:27 AM Re: KiXgolf: Mayan Number Converter - Public Phase
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I dont know - your variation of the left right thingy looked pretty unique.
Top
#164968 - 2006-07-28 12:47 AM Re: KiXgolf: Mayan Number Converter - Public Phase
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
hmmm, this is kinda ugly eh ?

$a=split("5 2 1 | : .")

it really doesn't save anything i think anyways

Top
#164969 - 2006-07-28 12:53 AM Re: KiXgolf: Mayan Number Converter - Public Phase
Lonkero Administrator Offline
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
#164970 - 2006-07-28 12:56 AM Re: KiXgolf: Mayan Number Converter - Public Phase
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
$b=$b/2

Brilliant.

Top
#164971 - 2006-07-28 01:05 AM Re: KiXgolf: Mayan Number Converter - Public Phase
Shawn Administrator Offline
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 Administrator Offline
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 Administrator Offline
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 Offline
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
#164975 - 2006-07-29 05:22 AM Re: KiXgolf: Mayan Number Converter - Public Phase
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Sounds like we've reached the final point. Looks like both Shawn and Jooel have optimized their code until there's barely anything left of it.
_________________________
There are two types of vessels, submarines and targets.

Top
#164976 - 2006-07-30 09:49 PM Re: KiXgolf: Mayan Number Converter - Public Phase
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
is the game still on?
Top
#164977 - 2006-07-30 09:59 PM Re: KiXgolf: Mayan Number Converter - Public Phase
Lonkero Administrator Offline
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 Offline
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 Administrator Offline
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
#164980 - 2006-07-31 01:41 AM Re: KiXgolf: Mayan Number Converter - Public Phase
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
tbh, I've been working for hours for a way to get rid of the + ' ' +
that adds extra five strokes for just a single space. stupid.

but no luck there either.

Top
Page 10 of 11 « First<7891011>


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 366 anonymous users online.
Newest Members
Timothy, Jojo67, MaikSimon, kvn317, kixtarts2025
17874 Registered Users

Generated in 0.084 seconds in which 0.031 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org