#66452 - 2002-06-09 05:08 AM
Kixtart Golf Part III - Chit-Chat
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Thought I would take the chit-chat out of the actual thread ...
Howard, how long to do this ?
code:
$start = @ticks ? BaseConverter("17777777777",8,10) ?"elapsed=" @ticks-$start
how many mhz ?
-Shawn
|
|
Top
|
|
|
|
#66453 - 2002-06-09 04:24 PM
Re: Kixtart Golf Part III - Chit-Chat
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
c:\data\scripts>C:\Data\Kix2001\KiX2001.410rc2\kix32 test1.kix
2147483647 elapsed=20
850 Mhz PIII
Did I get it right? [ 09 June 2002, 16:25: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
#66454 - 2002-06-09 11:19 PM
Re: Kixtart Golf Part III - Chit-Chat
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Howard,
I got an idea for the KiXGolf Scoring script. How about, when designing the puzzle UDF, we place the UDF as the first thing in the script - then have it so that we can put some kinda of flag or identifier, right after the UDF, maybe as a comment, like this:
code:
function puzzle() ; jazz... endfunction
;! < --- here's a flag
$result = puzzle() ? $result ;other stuff
then the KiXgolf script can just score everything up to the ;! (or whatever delimiter you want) !!! Just a thought - or maybe laydown more rules about the script that will make it easier to edit, test and score - all at the same time.
-Shawn [ 10 June 2002, 01:23: Message edited by: Shawn ]
|
|
Top
|
|
|
|
#66455 - 2002-06-10 01:18 AM
Re: Kixtart Golf Part III - Chit-Chat
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
I ran it and got:
C:\kix\KiX2001.410rc2\scripts>kix32 test4.kix
2147483647 elapsed=10
1200 MhZ Duron
Brian
|
|
Top
|
|
|
|
#66456 - 2002-06-10 01:51 AM
Re: Kixtart Golf Part III - Chit-Chat
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Shawn, I like that idea of the ";!" flag to abort the scoring script from considering characters after that.
|
|
Top
|
|
|
|
#66457 - 2002-06-10 02:05 AM
Re: Kixtart Golf Part III - Chit-Chat
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Put: Function FunctionName() ... EndFunction ;!
other stuff
The script will stop counting at the ";!"
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. Function KixGolf($A) if open (1,$A) = 0 $stop=0 $X=0 $Q="" $C=readLine(1) while @error=0 and $stop=0 $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 $C=readLine(1) if instr($C,";!") > 0 $stop=1 endif loop else ? "$A ??" ; Show bad file name endif if $Q<>"" ? "Mis-matched quotes. Probable score error." ? endif $KixGolf=$X EndFunction
? "KixGolf score = " + KixGolf($A) ;$A must be initialized on the command line. ;%tmp%\kix32 kixgolf.kix $A=Kixgolf.kix
|
|
Top
|
|
|
|
#66458 - 2002-06-10 06:37 PM
Re: Kixtart Golf Part III - Chit-Chat
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Nothing like a lttle Golf to get those post counts climbing.
|
|
Top
|
|
|
|
#66462 - 2002-06-10 07:09 PM
Re: Kixtart Golf Part III - Chit-Chat
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Should be easy Shawn. Give me a couple minutes. I have to get caught up with things at my desk then I'll post an update.
|
|
Top
|
|
|
|
#66464 - 2002-06-10 08:20 PM
Re: Kixtart Golf Part III - Chit-Chat
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
40 minutes left... who all is/has worked on this, anyway?
Brian
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 973 anonymous users online.
|
|
|