#178248 - 2007-07-23 09:26 PM
Re: KiXgolf Freebie: Quicksum
[Re: Benny69]
|
acmp
Getting the hang of it
Registered: 2004-07-02
Posts: 69
Loc: Bingham, Nottinghamshire, Engl...
|
Benny69, I have no idea why that works
What is going on?
I guess the left($,~) is some sort of walk through the string...
But I just can't see how this works. Any chance of an explination?
_________________________
Every day is a school day
|
Top
|
|
|
|
#178252 - 2007-07-23 09:35 PM
Re: KiXgolf Freebie: Quicksum
[Re: Lonkero]
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
acmp, left($,~) chops off the right most chr so ACM becomes AC, then it is sent back into the loop and then i am calling the function to create the count down a(left($,~))
Edited by Benny69 (2007-07-23 09:38 PM)
|
Top
|
|
|
|
#178253 - 2007-07-23 09:41 PM
Re: KiXgolf Freebie: Quicksum
[Re: Benny69]
|
acmp
Getting the hang of it
Registered: 2004-07-02
Posts: 69
Loc: Bingham, Nottinghamshire, Engl...
|
Thanks Benny69
_________________________
Every day is a school day
|
Top
|
|
|
|
#178259 - 2007-07-23 09:57 PM
Re: KiXgolf Freebie: Quicksum
[Re: Lonkero]
|
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4549
Loc: USA
|
Jooel... Here is your 85 down to 83/82
Function a($)
dim $b
for $b=1 to 0^$
$a=$a+$b*split(asc(substr($,$b))-64,"-")[0]
EndFunction
|
Top
|
|
|
|
#178260 - 2007-07-23 09:57 PM
Re: KiXgolf Freebie: Quicksum
[Re: Allen]
|
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4549
Loc: USA
|
And here is my 82/81
Function a($)
dim $b
if $
$b=asc(right($,1))-64
$a=a(left($,~))+($b>)*$b*(0^$)
;endif
EndFunction
|
Top
|
|
|
|
#178261 - 2007-07-23 10:03 PM
Re: KiXgolf Freebie: Quicksum
[Re: Allen]
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
wow Allen, ours is very similar
|
Top
|
|
|
|
#178262 - 2007-07-23 10:05 PM
Re: KiXgolf Freebie: Quicksum
[Re: Allen]
|
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4549
Loc: USA
|
ugghhh....Must pull away from computer... must work.... (dang golf!)
|
Top
|
|
|
|
#178264 - 2007-07-23 10:07 PM
Re: KiXgolf Freebie: Quicksum
[Re: Allen]
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
here is 81:
Function a($)
dim $b
if $
$b=asc(right($,1))-64
$a=a(left($,~))+($b>)*$b*($^)
EndFunction
|
Top
|
|
|
|
#178265 - 2007-07-23 10:11 PM
Re: KiXgolf Freebie: Quicksum
[Re: Benny69]
|
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4549
Loc: USA
|
nice... I never thought of that...
here is my other entry with your genius:
83/82
Function a($)
dim $i,$b
for $i=1 to $^
$b=asc(substr($,$i))-64
if $b>0
$a=$a+$i*$b
;endif
;next
EndFunction
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 465 anonymous users online.
|
|
|