#181641 - 2007-10-16 01:47 AM
Re: KiXgolf: Linear Pachinko - Public Round
[Re: Lonkero]
|
Benny69
Moderator
   
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
Idk but strange thing is that this does, which I think is the same thing:
Function a($b)
$a=e($b)*50/($b^)
EndFunction
Function e($b)
Dim $c,$,$d
$=Join(Split($b,_),$)
While $
$d=$c<'/'
$c=$
$=Right($,~)
$d=($<'/')+$d
$e=$e+IIf($c>_,$d,2*($c<'/' | $c<_&$d))
;Loop
EndFunction
|
|
Top
|
|
|
|
#181642 - 2007-10-16 01:48 AM
Re: KiXgolf: Linear Pachinko - Public Round
[Re: Benny69]
|
Benny69
Moderator
   
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
|
|
Top
|
|
|
|
#181653 - 2007-10-16 08:56 AM
Re: KiXgolf: Linear Pachinko - Public Round
[Re: Jochen]
|
Jochen
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
K, your code:
function a($b)
dim $c,$,$d,$!
$=join(split($b,_),$)
while $
$d=$c<'/'
$c=$
$=right($,~)
$d=$d+($<'/')
$!=$!+iif($c>_,$d,2*($c<'/'|$c<_&$d))
; loop
$a=$!*50/($b^)
endfunction
doesn't return anything for test cases 4 and 9 because it never enters the loop... the join(split($b,_),$) renders $ empty as there are only _ characters
Dale's adaption on the other hand returns a 0 as it calculates even if $ gets emptied in the second function.
Clear?
edit: I had this in the make too :roll:
Edited by Jochen (2007-10-16 09:01 AM)
_________________________
|
|
Top
|
|
|
|
#181669 - 2007-10-16 02:31 PM
Re: KiXgolf: Linear Pachinko - Public Round
[Re: Jochen]
|
Benny69
Moderator
   
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
Congrats guys, good round of KiXGolf.
Gargoyle, Well done, glad you joined us.
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
1 registered
(Allen)
and 1198 anonymous users online.
|
|
|