#66387 - 2002-06-09 04:13 PM
Re: KiXtart Golf Tournament Part III !!!
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Jens, on the W2K issue. I have seen on NT4 the logout after logon caused by lack of permissions on the C:\winnt directory and subdirectories.
So we can shorten the variables and UDF name from what you specified in the rules?
Function BaseConverter($value,$frombase,$tobase) ... Endfunction
To $f=a($b,$c,$d) ?
|
Top
|
|
|
|
#66389 - 2002-06-09 05:31 PM
Re: KiXtart Golf Tournament Part III !!!
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
I am still squashing some bugs that show themselves quite easily when converting to base2 using my approach. In case some one out there has implemented similiar functionality, I suggest that everyone verify proper functionality and result when BaseConverter("52",10,2) or BaseConverter("49",10,2). [ 09 June 2002, 17:32: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#66392 - 2002-06-09 06:46 PM
Re: KiXtart Golf Tournament Part III !!!
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Darn:
KixGolf score = 446
|
Top
|
|
|
|
#66393 - 2002-06-09 07:35 PM
Re: KiXtart Golf Tournament Part III !!!
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
KixGolf score = 397
{edit} forgot the code:
$=B($v,$d,$e)
KixGolf score = 410
Tweak Tweak Tweak KixGolf score = 381 [ 09 June 2002, 19:59: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#66394 - 2002-06-09 08:29 PM
Re: KiXtart Golf Tournament Part III !!!
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
ah - ok - going to play rough are we ?
plus - do you dim your local vars ?
1sec ...
Howard, whats this:
$=B($v,$d,$e)
is that what your using to call your function ? did you change the function protoype as well ?
HI DANA EDDY !!! GOOD TO SEE YOU ONLINE !!! [ 09 June 2002, 20:33: Message edited by: Shawn ]
|
Top
|
|
|
|
#66395 - 2002-06-09 08:37 PM
Re: KiXtart Golf Tournament Part III !!!
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
That is the function call. I shortened it based on Jens comments earlier. I explicitly ask him for a ruling on "$=B($v,$d,$e)" vs. "$result=BaseConverter($value,$frombase,$tobase)", but he has yet to respond. Until then I was going to be aggressive.
He said that the function call had to be included.
I only Dim'ed what was necessary for my code to function - (0). Oh, I am giving away the farm here. [ 09 June 2002, 20:38: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#66396 - 2002-06-09 08:48 PM
Re: KiXtart Golf Tournament Part III !!!
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
well, guess we should get a ruling on this but personally, i think we should be allowed to shorten anything that isn't exposed to the UDF user, so this would be the minimum prototype:
function baseconverter($v,$f,$t)
and probably all $vars should be dimmed because they could possibly affect the user as well.
oh yeah, and maybe going forward, the puzzle should be phrased as:
? baseconverter($v,$f,$t)
instead of
$result = baseconverter($v,$f,$t)
that way, we don't have to keep commenting and deleting lines to get a KiXgolf count. [ 09 June 2002, 21:11: Message edited by: Shawn ]
|
Top
|
|
|
|
#66397 - 2002-06-09 09:07 PM
Re: KiXtart Golf Tournament Part III !!!
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
Based on the above discussion:
KixGolf score = 351
correction, forgot to put the quotes around the old and new base (in the call) [ 09 June 2002, 21:10: Message edited by: Shawn ]
|
Top
|
|
|
|
#66398 - 2002-06-09 09:11 PM
Re: KiXtart Golf Tournament Part III !!!
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Crap
{edit} KixGolf score = 341 [ 09 June 2002, 21:53: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#66399 - 2002-06-09 10:07 PM
Re: KiXtart Golf Tournament Part III !!!
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
KixGolf score = 337
its a mad house ! a maaaaaaad hoooooowse !!!!
its getting hard for me to understand my own udf [ 09 June 2002, 22:09: Message edited by: Shawn ]
|
Top
|
|
|
|
#66400 - 2002-06-09 10:11 PM
Re: KiXtart Golf Tournament Part III !!!
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
My daughter wants to go to the pool. How is that going to happen if you keep cutting stroke off your score?
|
Top
|
|
|
|
#66403 - 2002-06-09 11:03 PM
Re: KiXtart Golf Tournament Part III !!!
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
KixGolf score = 293
Not including calling the function.. but includes all parts of the function! (THIS ONE WORKS, BABY!... fast, too!) (hmm. add 40 to get the test function given... but I don't think it should count.
Brian
{edit} make that 289.. (hmm. i suppose it's bad code not to initialize variables?) Maybe still 293.. lol
{edit again} make that 287... I don't think I can trim much more out of this, though.
{edit again} ok.. make that 278... although I'm pretty positive with this method I can't get it any smaller.. [ 09 June 2002, 23:17: Message edited by: BrianTX ]
|
Top
|
|
|
|
#66404 - 2002-06-09 11:10 PM
Re: KiXtart Golf Tournament Part III !!!
|
Sealeopard
KiX Master
Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
|
Okay guys, I'm going to comment on the function call issue:
code:
$result=BaseConverter('44680832201','10','36')
is the function call to the UDF. Therefore I expect the function itself to be in this form in order to get the lowest score:
code:
FUNCTION BaseConverter($b,$c,$d) ;the code itself ENDFUNCTION
To be fair, we should keep the function name itself as BaseConverter. With regards to the DIM issues, since KiXtart does not require to DIM a variable (according to the manual), you don't need to do it either, unless it would cause problems inside your code.
And, BTW, the call to the function does not count, just the function itself (FUNCTION to ENDFUNCTION). Oh, and if you're using another UDF that is called by your main UDF, that one of course counts too. Just in case somebody wrote a custom MOD() or POWER() UDF.
Finally, the BaseConverter doesn't need to work for fractional numbers, just integers. BrianTX, you asked for clarification
_________________________
There are two types of vessels, submarines and targets.
|
Top
|
|
|
|
#66406 - 2002-06-09 11:21 PM
Re: KiXtart Golf Tournament Part III !!!
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
I found a slight bug in formatting.. fiddling with it.. may actually cut more code... or not! lol
Brian [ 09 June 2002, 23:24: Message edited by: BrianTX ]
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
1 registered
(Allen)
and 444 anonymous users online.
|
|
|