Page 1 of 1 1
Topic Options
#66452 - 2002-06-09 05:08 AM Kixtart Golf Part III - Chit-Chat
Shawn Administrator Offline
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 Offline
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 ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#66454 - 2002-06-09 11:19 PM Re: Kixtart Golf Part III - Chit-Chat
Shawn Administrator Offline
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 Offline
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 Offline
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.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#66457 - 2002-06-10 02:05 AM Re: Kixtart Golf Part III - Chit-Chat
Howard Bullock Offline
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

_________________________
Home page: http://www.kixhelp.com/hb/

Top
#66458 - 2002-06-10 06:37 PM Re: Kixtart Golf Part III - Chit-Chat
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Nothing like a lttle Golf to get those post counts climbing. [Eek!]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#66459 - 2002-06-10 06:51 PM Re: Kixtart Golf Part III - Chit-Chat
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
You guys are getting too esoteric and cryptic for me. You don't seem to bother posting your scripts anymore. I don't think that I am capable of playing in this league but it might be fun to watch.
_________________________
Jack

Top
#66460 - 2002-06-10 06:51 PM Re: Kixtart Golf Part III - Chit-Chat
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Im going to be a real bugger here Howard, but is there a way to have it so that the KiXGolf script will only count chars BETWEEN markers ? That way, I (we) can put our test calls, and whatever else BEFORE the function to be counted ? Example:

---8<---

break on

stuff...
more stuff...

;! start counting here

function puzzle(...)
stuff ...
endfunction

;! stop counting here

more stuff ...
exit 1

---8<---

kinda thingy dooey ? - I like putting my functions last in the script ...

[ 10 June 2002, 18:53: Message edited by: Shawn ]

Top
#66461 - 2002-06-10 06:56 PM Re: Kixtart Golf Part III - Chit-Chat
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Jack:

In order to fully understand what this is about, you will need to at least read this: KiXtart Golf Tournament Part III !!!. Or better, since there are still 2 hours left, participate. Or, even better, wait until the codes have been posted and try to make sense out of it.
_________________________
There are two types of vessels, submarines and targets.

Top
#66462 - 2002-06-10 07:09 PM Re: Kixtart Golf Part III - Chit-Chat
Howard Bullock Offline
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.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#66463 - 2002-06-10 07:28 PM Re: Kixtart Golf Part III - Chit-Chat
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I've been watching the game from the gallery. Way, WAY, W A Y, out of my league...

Kinda reminds me of how I would shave bytes off some machine code to fit on my Sinclair. Now I'm reminiscing like an old fart... wait a minute... I am an old fart. [Eek!]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#66464 - 2002-06-10 08:20 PM Re: Kixtart Golf Part III - Chit-Chat
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
40 minutes left... who all is/has worked on this, anyway?

Brian

Top
#66465 - 2002-06-10 08:54 PM Re: Kixtart Golf Part III - Chit-Chat
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
sealeopard,

Ok, I read the rules. I now understand but it is a little mystifying for observers.
_________________________
Jack

Top
Page 1 of 1 1


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

Who's Online
0 registered and 1179 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.068 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

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