#178203 - 2007-07-23 03:08 PM
Re: KiXgolf Freebie: Quicksum
[Re: Arend_]
|
Arend_
MM club member
Registered: 2005-01-17
Posts: 1895
Loc: Hilversum, The Netherlands
|
91:
Function a($)
Dim $x, $y
For $x = 0 to Len($)
$y = Asc(SubStr($,$x))
If $y>64 $a=$a+($x*($y-64))
EndFunction
|
Top
|
|
|
|
#178204 - 2007-07-23 03:12 PM
Re: KiXgolf Freebie: Quicksum
[Re: Arend_]
|
Arend_
MM club member
Registered: 2005-01-17
Posts: 1895
Loc: Hilversum, The Netherlands
|
90:
Function a($b)
Dim $, $y
For $ = 0 to Len($b)
$y = Asc(SubStr($b,$))
If $y>64 $a=$a+($*($y-64))
EndFunction
Presumably final code, basically not mine anymore but Witto's and Jochen's code.
|
Top
|
|
|
|
#178211 - 2007-07-23 03:26 PM
Re: KiXgolf Freebie: Quicksum
[Re: Arend_]
|
Witto
MM club member
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
That gives you at least 1 point for participating
|
Top
|
|
|
|
#178212 - 2007-07-23 03:35 PM
Re: KiXgolf Freebie: Quicksum
[Re: Witto]
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
My slightly different approach. More shots (86), but I get to see more of the unusual scenery
Function a($)
Dim $i,$s
While $
$i=$i+1
$s=Asc($)-64
$=SubStr($,2)
$a=$a+$i*$s*($s>)
EndFunction
|
Top
|
|
|
|
#178213 - 2007-07-23 03:56 PM
Re: KiXgolf Freebie: Quicksum
[Re: Witto]
|
acmp
Getting the hang of it
Registered: 2004-07-02
Posts: 69
Loc: Bingham, Nottinghamshire, Engl...
|
I've got a respectable 99 for my first ever go at kixgolf. I'm happy.
when do we post code?
[edit] Oop's just refereshed the list and saw all the code.
Edited by acmp (2007-07-23 03:57 PM) Edit Reason: stupid me
_________________________
Every day is a school day
|
Top
|
|
|
|
#178215 - 2007-07-23 04:03 PM
Re: KiXgolf Freebie: Quicksum
[Re: acmp]
|
acmp
Getting the hang of it
Registered: 2004-07-02
Posts: 69
Loc: Bingham, Nottinghamshire, Engl...
|
Just reviewed some code and got down to 90
Is it really ok to not close If's and other loops?
Any way, my code is:
Function a($)
dim $q, $w
for $q = 1 to len($)
$w=asc(substr($,$q,1))-64
if $w>0 $a=$a+($w*$q)
endfunction
_________________________
Every day is a school day
|
Top
|
|
|
|
#178220 - 2007-07-23 04:31 PM
Re: KiXgolf Freebie: Quicksum
[Re: Allen]
|
acmp
Getting the hang of it
Registered: 2004-07-02
Posts: 69
Loc: Bingham, Nottinghamshire, Engl...
|
Good score Allen,
any clues?
_________________________
Every day is a school day
|
Top
|
|
|
|
#178221 - 2007-07-23 04:37 PM
Re: KiXgolf Freebie: Quicksum
[Re: acmp]
|
acmp
Getting the hang of it
Registered: 2004-07-02
Posts: 69
Loc: Bingham, Nottinghamshire, Engl...
|
After a clarification,
Is
legal?
I didn't think you could edit the base code. So, I'm at 86, or 85 if I cheat.
_________________________
Every day is a school day
|
Top
|
|
|
|
#178222 - 2007-07-23 04:39 PM
Re: KiXgolf Freebie: Quicksum
[Re: acmp]
|
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4549
Loc: USA
|
I'm waiting on a few others to post scores yet...
Here's a hint acmp. ()
|
Top
|
|
|
|
#178223 - 2007-07-23 04:50 PM
Re: KiXgolf Freebie: Quicksum
[Re: acmp]
|
acmp
Getting the hang of it
Registered: 2004-07-02
Posts: 69
Loc: Bingham, Nottinghamshire, Engl...
|
Had a genius moment:
Your solution passed all tests
KiXtart KiXtart Version = 4.53 KiXGolf Script = kixgolf_qs.kix
Computer OS = Windows XP Professional CPU = Intel(R) Pentium(R) 4 CPU 3.00GHz Speed = 2992 MHz Memory = 1022 MB
KiXGolf Scoring Engine Scoring Engine = 3.3
KiXtart Golf Score Tournament = Quicksum Processing Start = 2007/07/23 15:52:58.464 Processing End = 2007/07/23 15:52:58.510 Duration = 0000/00/00 00:00:00.046 KiXGolf Score = 83
Thank you for participating in KiXtart Golf! Could be 82 with the cheat!
Edited by acmp (2007-07-23 04:53 PM) Edit Reason: updated return info, was the _QS.txt file
_________________________
Every day is a school day
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 255 anonymous users online.
|
|
|