Page 3 of 6 <12345>Last »
Topic Options
#66610 - 2002-06-11 05:56 AM Re: Round 2: KiXtart Golf Tournament Part III
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Sorry, missed that one.

$n=$b*$+$n

I missed the $n on the right side of the equation and took this line for a proper initialization.

$n=0

added +4 strokes.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#66611 - 2002-06-11 05:59 AM Re: Round 2: KiXtart Golf Tournament Part III
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Hey, reuse the single $ in the second part ?

code:
Function BaseConverter($v,$f,$t)
$i = len($v)
$=1.
Do
$x = substr($v,$i,1)
if $x > 9
$x = ASC(ucase($x)) - 55
endif
$n=$*$x+$n
$=$*$f
$i=$i-1
Until $i=0

$c=""
While $n
$ = INT($n - (INT($n/$t) * $t))
$n = ($n-$)/$t
IF $ > 9
$ = CHR($ + 55)
ENDIF
$c = ""+$+"$c"
Loop
$BaseConverter = $c
Endfunction
;!
BaseConverter('44680832201',10,36) ?
BaseConverter('52',10,2) ?
BaseConverter('Kixtart',36,10) ?

242

plus, this:

$c = ""+$+$c

might shave two more ? haven't tested too fully.

[ 11 June 2002, 06:01: Message edited by: Shawn ]

Top
#66612 - 2002-06-11 06:04 AM Re: Round 2: KiXtart Golf Tournament Part III
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Shawn, look a couple post above yours @ posted 11 June 2002 05:28 . We also needed to read $n=0

[ 11 June 2002, 06:05: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#66613 - 2002-06-11 06:14 AM Re: Round 2: KiXtart Golf Tournament Part III
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
k - Hey Howard, do you have that modified version of KiXgolf, the one that has the BETWEEN markers ? I just inflicted the "no break on at top of script logoff of death" on myself - for the second time in as many days [Frown]
Top
#66614 - 2002-06-11 06:27 AM Re: Round 2: KiXtart Golf Tournament Part III
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
New KixGolf for Shawn.
code:
; This function scores the specified file and returns
; the KixGolf score. That is the total number of key strokes
; used to build a script not counting comments, spaces, tabs,
; or any ascii character above 126.
;
; The script will start counting on "odd" (1,3,5,...) occurrances
; of ";!" and the script will not count after "even" (0,2,4,...)
; instances of ";!".
;
;Syntax: %tmp%\kix32 kixgolf.kix $A=Kixgolf.kix
;

Function KixGolf($A)
if open (1,$A) = 0
$X=0
$Q=""
$C=readLine(1)
while @error=0
if instr($C, ";!")>0
$countem = $countem + 1 & 1
endif
If $countem
$j=len($C) ; Get length of the line
for $h=1 to $j ; Loop through each character in line
$D=asc(substr($C,$h,1))
if $D=34 or $D=39
if $Q=""
$Q=$D
else
if $Q=$D
$Q=""
endif
endif
endif

if $D=59 ; Ignore comment lines
$h=$j ; Terminate loop
else
if $Q<>""
$X=$X+1 ; Count the valid characters
else
if $D>32 and $D<127
$X=$X+1 ; Count the valid characters
endif
endif
endif
next
endif
$C=readLine(1)
loop
else
? "$A ??" ; Show bad file name
endif
if $Q<>""
? "Mis-matched quotes. Probable score error." ?
endif
$KixGolf=$X
EndFunction

;$A must be initialized on the command line.
;%tmp%\kix32 kixgolf.kix $A=Kixgolf.kix

? "KixGolf score = " + KixGolf($A)



[ 11 June 2002, 06:32: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#66615 - 2002-06-11 07:26 AM Re: Round 2: KiXtart Golf Tournament Part III
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
"My 1st program is wrong. It drops Zeroes."

howard, this was the thingie I thought I found.
but in different contest...
_________________________
!

download KiXnet

Top
#66616 - 2002-06-11 07:29 AM Re: Round 2: KiXtart Golf Tournament Part III
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
When performing what Jens wanted Base10 to base36 with KIXTART as the answer it works. Going backward it failed.

You have a private message waiting.

[ 11 June 2002, 07:32: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#66617 - 2002-06-11 10:24 AM Re: Round 2: KiXtart Golf Tournament Part III
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
thank howie...

I even understood your message, utleast partly.
looking into that.
_________________________
!

download KiXnet

Top
#66618 - 2002-06-11 01:08 PM Re: Round 2: KiXtart Golf Tournament Part III
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
howard, used that your kixgolf-udf.
it does give my script score 0.

so I'm the winner of the shorters code?
_________________________
!

download KiXnet

Top
#66619 - 2002-06-11 03:08 PM Re: Round 2: KiXtart Golf Tournament Part III
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
The script was modified to look for ;! to start and stop counting.

So:

Break on
BaseConverter('Kixtart',36,10) ?

;! Start counting on next line
Function ...

EndFunction
;! Stop counting
More code not counted...
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#66620 - 2002-06-11 03:23 PM Re: Round 2: KiXtart Golf Tournament Part III
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Howard, thanks buddy, works a charm on my test script - but its funny now because kixgolf.kix complains about mis-matched quotes, when you run it against itself - which would figure, I guess, thanks again !
Top
#66621 - 2002-06-11 03:48 PM Re: Round 2: KiXtart Golf Tournament Part III
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Okay, I think I will make the final call on the '$' issue. I am really torn between allowing it and not allowing it because it is an 'elegant' solution with regards to shaving off characters in a KiXtart script.

So, final answer: As long as KiXtart supports a single '$' as a valid variable it can be used in the KiXtart Golf Tournament. Nevertheless, KiXtart Golf tournament scripts must be functioning scripts/UDFs that continue to work even after executing it twice in a row.

I hope that clears up the issue nad I am truely sorry if this caused trouble in the previous tournaments.

The rules for the next tournament will incorporate this change and I will try to make the rules as watertight as possible with regards to what is allowed and what not.

BTW, there is still time to post new codes and see whether the KiXtart Golf score can be lowered. Current leader seems to be Shawn with a score of 242.
_________________________
There are two types of vessels, submarines and targets.

Top
#66622 - 2002-06-11 04:00 PM Re: Round 2: KiXtart Golf Tournament Part III
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
boys...
what you think should outcome from:
$e=44680832201 $t=10
$d=0+$e/$t
d's outcome is: 0
vartypename: long

is this the thing which should work. when reading manuals:
"The type of a variable is automatically changed to the result of the expression that is assigned to it."

so kix can't handle these variable types yet properly?

btw. I DID IT!
_________________________
!

download KiXnet

Top
#66623 - 2002-06-11 04:00 PM Re: Round 2: KiXtart Golf Tournament Part III
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Jens, I believe in evolution with regard to KixGolf, divine creation seems to be out of the question. [Smile]

[ 11 June 2002, 16:01: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#66624 - 2002-06-11 04:15 PM Re: Round 2: KiXtart Golf Tournament Part III
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
I did some test with the long math elements, too
code:
? @KIX

; this is a number KiXtart cannot handle as integer
$e=44680832201
? '$$e='+$e

$t=10
? '$$t='+$t

$d=0+$e/$t
? '$$d=0+$$e/$$t='+$d

$d=0.+$e/$t
? '$$d=0.+$$e/$$t='+$d

$e=44680832201.
? '$$e='+$e

$d=0+$e/$t
? '$$d=0+$$e/$$t='+$d

$d=0.+$e/$t
? '$$d=0.+$$e/$$t='+$d

gives an output of
code:
4.10 Release Candidate 2
$e=1731159241
$t=10
$d=0+$e/$t=173115924
$d=0.+$e/$t=173115924
$e=44680832201
$d=0+$e/$t=0
$d=0.+$e/$t=4468083220.1

The first time $e gets misassigned because Kixtart cannot handle an integer that large. But, what happens int he next to last $d calculation? It should definitely not be '0'?
_________________________
There are two types of vessels, submarines and targets.

Top
#66625 - 2002-06-11 04:34 PM Re: Round 2: KiXtart Golf Tournament Part III
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
this is stupid.
I got to 270 and tried to got code more by avoiding
if $targetbase="10" goto "end"
call.
this was only 10 chars but cutting it off, I get my code all messed up...

going home.
_________________________
!

download KiXnet

Top
#66626 - 2002-06-11 05:02 PM Re: Round 2: KiXtart Golf Tournament Part III
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Is this simpler?
code:
$A=ASC($X)
$A=$A-48-($A>64)*7

{EDIT} Nope {/EDIT}

[ 11 June 2002, 17:05: Message edited by: Richard Howarth ]

Top
#66627 - 2002-06-11 05:08 PM Re: Round 2: KiXtart Golf Tournament Part III
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
Hmm. think we can break the 220 mark? Uh-oh.. formula isn't 100% accurate..darnit... have to rework it again.. Weird.. it looks like it works correctly..hmmm.... but my answers don't come out right.

Brian

[ 11 June 2002, 17:14: Message edited by: BrianTX ]

Top
#66628 - 2002-06-11 06:26 PM Re: Round 2: KiXtart Golf Tournament Part III
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
I got it down to 235 now... [Smile]

I'll post it eventually.. lol

Brian

{edit} make that 233...
{edit} make that 232...
{edit} make that 231...

[ 11 June 2002, 18:37: Message edited by: BrianTX ]

Top
#66629 - 2002-06-11 06:28 PM Re: Round 2: KiXtart Golf Tournament Part III
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
You should definitely post it before you shrink it down to 0 [Wink]
_________________________
There are two types of vessels, submarines and targets.

Top
Page 3 of 6 <12345>Last »


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

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

Generated in 0.072 seconds in which 0.024 seconds were spent on a total of 13 queries. Zlib compression enabled.

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