#66671 - 2002-06-12 05:01 PM
Re: Round 2: KiXtart Golf Tournament Part III
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
OK.. this is with error correction/detection.. can anyone do better (or find bugs if there are any? (probably... this is first try).
code:
Function BaseConverter($v,$f,$t) $t=INT($t) $f=INT($f) $e = ($f>36)|($t>36)|($f<2)|($t<2) $=0 $y=1. for $n=len($v) to 1 step -1 $x = ASC(UCASE(substr($v,$n,1))) $z = ($x - 48 - ($x > 64) * 7) IF ($Z<0)|(($x>57)&($X<65))|$e|($Z>($f-1)) EXIT 1 ENDIF $=$y * $z +$
$y=$y*$f next $n="" While $ $x = INT($ - (INT($/$t) * $t)) $ = ($-$x)/$t $n = CHR($x + 48 + ($x > 9) * 7) + $n Loop $BaseConverter = $n Endfunction
KixGolf score = 336
Brian [ 12 June 2002, 17:18: Message edited by: BrianTX ]
|
Top
|
|
|
|
#66672 - 2002-06-12 05:05 PM
Re: Round 2: KiXtart Golf Tournament Part III
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
BLAG.. got to check for non-int values... will edit above.
Brian
|
Top
|
|
|
|
#66674 - 2002-06-12 05:14 PM
Re: Round 2: KiXtart Golf Tournament Part III
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
I'm confused as to why this wouldn't run in Win9x. It seems to work fine on Win9x as far as I can tell.
{edit} On the empty string returned, I prefer to think of it as "0".. especially since converting 0 yields an empty string "".
Brian [ 12 June 2002, 17:21: Message edited by: BrianTX ]
|
Top
|
|
|
|
#66676 - 2002-06-15 04:14 PM
Re: Round 2: KiXtart Golf Tournament Part III
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Brian, I have already posted a UDF to the library that requires BaseConverter(). Are you going to post the UDF to the Library?
{edit} I just changed the requirement. I no longer use BaseConverter. Changed to DecToHex(). [ 15 June 2002, 16:34: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#66677 - 2002-06-16 03:50 AM
Re: Round 2: KiXtart Golf Tournament Part III
|
MCA
KiX Supporter
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,
Indeed it is a real tournament. We think the item with the most replies:
- 3382 14 - 3418 33 - 3447 84 - 3448 13 - 3458 105
(total 249 replies)
greetings.
|
Top
|
|
|
|
#66678 - 2002-06-16 08:01 AM
Re: Round 2: KiXtart Golf Tournament Part III
|
MCA
KiX Supporter
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,
We miss one topic. Current values are:
- 3382 14 - 3418 33 - 3447 84 - 3448 13 - 3458 105 - 3459 11 (total 260 replies)
greetings
|
Top
|
|
|
|
#66680 - 2002-06-28 06:38 PM
Re: Round 2: KiXtart Golf Tournament Part III
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
Nope.. I didn't post it... I got tired of fiddling with it, so I went to other things. I was hoping someone else would verify and/or improve the error correction.
Brian
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 239 anonymous users online.
|
|
|