#199550 - 2010-08-14 02:00 PM
Re: KixGolf: Luhn's Mod - Public Round
[Re: Lonkero]
|
Allen
KiX Supporter
![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif)
Registered: 2003-04-19
Posts: 4548
Loc: USA
|
Nice Lonk...
$a=(2<$ & 7>$ & $x mod 10=)*$a
This is the line I was hunting for when I was fooling with it... I knew there had to be a way to do it without just setting $a=0.
$x=(1&$t) *(1.1*$a)+$a+$x
1.1 eh? I'm still trying to understand how this works... looking at it now
|
Top
|
|
|
|
#199558 - 2010-08-14 06:09 PM
Re: KixGolf: Luhn's Mod - Public Round
[Re: Lonkero]
|
Allen
KiX Supporter
![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif)
Registered: 2003-04-19
Posts: 4548
Loc: USA
|
It worked... but failed the tester...
KiXtart Golf Score
Tournament = KiXtart Golf: Luhn's Mod
Processing Start = 2010/08/14 12:05:58.799
Processing End = 2010/08/14 12:05:58.808
Duration = 0000/00/00 00:00:00.008
# Tests Run = 40
# Tests Passed = 26
# Tests Failed = 14
Result = failed
KiXGolf Score = 126
|
Top
|
|
|
|
#199564 - 2010-08-14 09:43 PM
Re: KixGolf: Luhn's Mod - Public Round
[Re: Lonkero]
|
Lonkero
KiX Master Guru
![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif) ![*](/forums/images/general/default/star.gif)
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
yeah... removing the need for array is the next step and then it becomes pretty close already to the other ones. 177.
Function A($)
$a = $^0
dim $i, $x, $b,$s
for $i = -$a to -1
$x = substr($,-$i,1)
$b = $b+'+'+($s*((4<$x)+$x)+$x)
$s=$s^1
next
$i = execute("$X="+$b)
$a = ($>3 & $<7 & $a=16-($<4) & $x mod 10=)*left($,1)
Endfunction
then execution becomes pointless... 151
Function A($)
$a = $^0
dim $i, $x, $b,$s
for $i = -$a to -1
$x = substr($,-$i,1)
$b = $b+$s*((4<$x)+$x)+$x
$s=$s^1
next
$a = ($>3 & $<7 & $a=16-($<4) & $b mod 10=)*left($,1)
Endfunction
_________________________
!download KiXnet
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 138 anonymous users online.
|
|
|