AllenAdministrator
(KiX Supporter)
2010-08-08 06:08 PM
KixGolf: Luhn's Mod - Public Round

Gentleman, please post your code.

maciep
(Korg Regular)
2010-08-08 06:12 PM
Re: KixGolf: Luhn's Mod - Public Round

Here's my 137 code

 Code:
Function A($)
	dim $s,$f
	$a = 0
	if $>3 & $<7 & len($)+($<4)=16
		while $
			$a = right($,1)
			$s = $s + $f*(-9*(4<$a)+$a) + $a
			$ = left($,-1)
			$f=1-$f
			if $s mod 10 $a =0
Endfunction


AllenAdministrator
(KiX Supporter)
2010-08-08 06:36 PM
Re: KixGolf: Luhn's Mod - Public Round

Hey Eric, would you mind explaining how you coded around these tests?

3456789012345675=0 valid luhn but 16 digits
456789012345671=0 valid luhn but 15 digits
567890123456781=0 ""
678901234567899=0 ""

Edit...actually maybe its just a valid Amkixpress I would be interested in.


DrillSergeant
(MM club member)
2010-08-08 06:39 PM
Re: KixGolf: Luhn's Mod - Public Round

Hey Maciep, our codes aren't that different!

124:
 Code:
Function A($)
Dim $c, $t

	While $
		$A = 0 + right($, 1)
		$t = 1 & $c * ($A / 5 + $A) + $A + $t
		$c = $c + 1
		$ = left($,~)
		If $t mod 10 | $c-15-$A/4 | 4&$A + 5
			$A = 0
Endfunction


AllenAdministrator
(KiX Supporter)
2010-08-08 06:49 PM
Re: KixGolf: Luhn's Mod - Public Round

@Drill... Pure encryption... I love it \:\) It'll take a while for me to figure out that one.

DrillSergeant
(MM club member)
2010-08-08 07:04 PM
Re: KixGolf: Luhn's Mod - Public Round

The two real kickers I added today were the binary calcutions:

1&$c and 4&$A + 5

The first one checks if the first bit of the digit is used, so this is true for every odd number and false for every even number.

1 = 0 0 0 1 = true
2 = 0 0 1 0 = false
3 = 0 0 1 1 = true
4 = 0 1 0 0 = false

The second one is just like that. the variable $A kan be anything from 0 to 9. Because I needed a range of 4 digits to check I check against the 3rd bit(= weight=4). (3, 4, 5, 6) since my range starts at 3 but the first number with a false 3rd bit is 8 I need to add 5 to my number to check.

so if we continue the table above:
2 + 5 = 7 = 0 1 1 1 = true (third bit = 1) Not correct
3 + 5 = 8 = 1 0 0 0 = false
4 + 5 = 9 = 1 0 0 1 = false
5 + 5 = 10 = 1 0 1 0 = false
6 + 5 = 11 = 1 0 1 1 = false
7 + 5 = 12 = 1 1 0 0 = true (third bit = true again) Not correct

Does this make it any clearer?


maciep
(Korg Regular)
2010-08-08 07:22 PM
Re: KixGolf: Luhn's Mod - Public Round

 Quote:

Hey Eric, would you mind explaining how you coded around these tests?

3456789012345675=0 valid luhn but 16 digits
456789012345671=0 valid luhn but 15 digits
567890123456781=0 ""
678901234567899=0 ""

Edit...actually maybe its just a valid Amkixpress I would be interested in.


I set $a to 0 by default. And then the if statement decides whether I even try to process string.

 Code:
if $>3 & $<7 & len($)+($<4)=16


the first condition ensures that string doesn't start with 0-2. The second condition makes sure it doesn't start with 7-9.

And the last condition makes sure that the length is 16 characters...but we need to add one if it starts with a 3. Since we are already discard 0-2, we can just check that it's less than 4 instead of exactly 3, so that condition will add 1 when appropriate.

So if starts with a 3 and isn't 15 characters long, we never drop into the loop.

Nice code Drill!! Definitely similar to mine, but you're golfing skillz are impressive! \:\)


DrillSergeant
(MM club member)
2010-08-08 07:36 PM
Re: KixGolf: Luhn's Mod - Public Round

By the way, this is another sneaky move too:

($A / 5 + $A)

If $A is a digit of 5 or greater, you need to add the two digits to get the relevant single digit number.

The calculation above doesn't do that, but just adds another 1 if the number is 5 or greater. This will give:

5 + 5 = 10 + 1(because of $A/5) = 11`
6 + 6 = 12 + 1 = 13
7 + 7 = 14 + 1 = 15

Now for the check if it's divisble by 10 it doesn't matter if you add another extra 10 to the total, so I had the same calculation as Eric, (-9 * ($A>4)) but replaced that (also today) for the calculation above.


Benny69
(MM club member)
2010-08-08 07:46 PM
Re: KixGolf: Luhn's Mod - Public Round

here is my 185 code:

 Code:
Function A($)
   Dim $y,$x,$v
   
   $x = Left($,1)
   For $y = ($^) to 1 step -2
      $a = 2 * SubStr($,$y-1,1)
      $v = IIf($a > 9,$a / -10 + $a,$a) + $v + SubStr($,$y,1)
      
      $a = IIf(~ $v mod 10 & (($^) = 15 & $x = 3) | (($^) = 16 & $x > 3 & $x < 7),$x,0)
   ;Next
EndFunction


AllenAdministrator
(KiX Supporter)
2010-08-08 07:47 PM
Re: KixGolf: Luhn's Mod - Public Round

So my question then is this...

if $>3 & $<7

wouldn't that only pickup 4 - 6?

Edit... just saw this...
"And the last condition makes sure that the length is 16 characters...but we need to add one if it starts with a 3. Since we are already discard 0-2, we can just check that it's less than 4 instead of exactly 3, so that condition will add 1 when appropriate. "

Hmmm... need to process... cool though.



Benny69
(MM club member)
2010-08-08 07:49 PM
Re: KixGolf: Luhn's Mod - Public Round

here is Eric's code at 135:

 Code:
Function A($)
Dim $s,$f
$a = 0
If $ > 3&$ < 7&($^)+($ < 4) = 16
   While $
      $a = Right($,1)
      $s = $s+$f*(-9*(4 < $a)+$a)+$a
      $ = Left($,-1)
      $f = 1-$f
      If $s mod 10 $a = 0
EndFunction


Benny69
(MM club member)
2010-08-08 07:57 PM
Re: KixGolf: Luhn's Mod - Public Round

here is my other 185 code:

 Code:
Function A($)
   Dim $z,$x,$v
   
   $z = Left($,1)
   $v = ($^)
   While $
      $a = 2 * SubStr($,($^)-1,1)
      $x = IIf($a > 9,$a / -10 + $a,$a) + Right($,1) + $x
      $ = Left($,-2)
      $a = IIf(~ $x mod 10 & ($v = 15 & $z = 3) | ($v = 16 & $z > 3 & $z < 7),$z,0)

;   Loop
EndFunction


LonkeroAdministrator
(KiX Master Guru)
2010-08-08 08:02 PM
Re: KixGolf: Luhn's Mod - Public Round

lol, damn. the first one I was thinking about too, never used.
second one. you have way too much energy! \:D

I have 2 versions of 134, I kinda like this the best:
 Code:
Function A($b)
dim $t,$,$x

for $t=0 to 99
 $=right($b,1)
 $x=$t mod 2*((4<$)+$)+$+$x
 $b=left($b,~)
 if $
  $a=($t=15-(3=$) & 2<$ & 7>$ & $x mod 10=0)*$
Endfunction


Benny69
(MM club member)
2010-08-08 08:06 PM
Re: KixGolf: Luhn's Mod - Public Round

Eric's at 134

 Code:
Function A($)
   Dim $s,$f
   $a = 0
   If $ > 3&$ < 7&($^)+($<4) = 16
      While $
         $a = Right($,1)
         $s = $s+$f*(-9*(4 < $a)+$a)+$a
         $ = Left($,~)
         $f = 1-$f
         If $s mod 10 $a = 0
EndFunction


maciep
(Korg Regular)
2010-08-08 09:27 PM
Re: KixGolf: Luhn's Mod - Public Round

 Quote:

if $>3 & $<7

wouldn't that only pickup 4 - 6?


nope '3xxxxx' is greater than 3 too...found that out when $>2 failed a few cases ;\)


maciep
(Korg Regular)
2010-08-08 09:39 PM
Re: KixGolf: Luhn's Mod - Public Round

 Quote:

Now for the check if it's divisble by 10 it doesn't matter if you add another extra 10 to the total, so I had the same calculation as Eric, (-9 * ($A>4)) but replaced that (also today) for the calculation above.


I KNEW there had to be a better way to do that...I like this one! I was pumped when I thought 2*$a mod 9 would work for all numbers...of course it failed for 9


BradV
(Seasoned Scripter)
2010-08-08 10:28 PM
Re: KixGolf: Luhn's Mod - Public Round

OK, I knew I was missing something! I'm embarrased to even post this. \:\)

 Code:
Function A($)
   dim $l, $i, $b, $c, $x, $d
   $l = Len($)
   $d = Left($, 1)
   If ($d = 3 and $l = 15) or ($d > 3 and $d < 7 and $l = 16)
      $x = 0
      For $i = $l - 1 to 0 Step -1
         $b = Substr($, $i + 1, 1)
         If ($l - $i) mod 2 = 0
            $c = 2 * $b
            $b = IIF($c > 9, 0 + Left($c, 1) + Right($c, 1), $c)
         EndIf
         $x = $x + $b
      Next
      $d = IIF($x mod 10, 0, $d)
   Else
      $d = 0
   EndIf
   $A = $d
EndFunction


AllenAdministrator
(KiX Supporter)
2010-08-08 11:08 PM
Re: KixGolf: Luhn's Mod - Public Round

Almost forgot... here is Jochen's 146

 Code:
function a($)
    dim $b, $c, $d
    $b = 0^$
    while $
        $c = (($b-($^) & 1)+1) * right($,1)
        $d = $d + $c-9*($c>9)
        $a = ($d mod 10 =) * (($b=15&$=3)|$b=16&$>3&$<7) * $
        $ = left($,~)
endfunction 


Benny69
(MM club member)
2010-08-09 12:51 AM
Re: KixGolf: Luhn's Mod - Public Round

Brad,
Don't feel embarrased, you should feel proud, most can't even put somthing together that works, that is a BIG hurtle. I say well done, now lets see what we can do to shorten that code.


Benny69
(MM club member)
2010-08-09 01:02 AM
Re: KixGolf: Luhn's Mod - Public Round

Brad's code at 240:

 Code:
Function A($)
   Dim $l,$i,$b,$c,$x,$d
   $l = ($^);Len($)
   $d = Left($,1)
   ;If($d = 3 And $l = 15) Or ( $d > 3 And $d < 7 And $l = 16 )
   If($d = 3 & $l = 15) | ( $d > 3 & $d < 7 & $l = 16 ); use Bitwise Operators to do the same tasks as 'And' and 'Or'
      $x = 0
      For $i = $l-1 to 0 Step-1
         $b = SubStr($,$i+1,1)
         If($l-$i) mod 2 = 0
            $c = 2*$b
            ;$b = IIf($c > 9,0+Left($c,1)+Right($c,1),$c)
            $b = IIf($c > 9,$c / 10 + $c - 10,$c); use a calulator to see that Kix drops the decimal for $c
         EndIf
         $x = $x + $b
      Next
      $d = IIf($x mod 10,0,$d)
   Else
      $d = 0
   EndIf
   $A = $d
EndFunction


Benny69
(MM club member)
2010-08-09 01:10 AM
Re: KixGolf: Luhn's Mod - Public Round

Brad,
Another way to shorten code is to try dropping an 'EndIf' or 'Next' or 'Loop', if your code is well organized this might save a few strokes. Also try reusing the same variable in different sections of the code.

Give it a try and show us what you come up with.


Benny69
(MM club member)
2010-08-09 01:16 AM
Re: KixGolf: Luhn's Mod - Public Round

I get an 'Expected,)!' error when I try Jochen's code.

Benny69
(MM club member)
2010-08-09 01:22 AM
Re: KixGolf: Luhn's Mod - Public Round

found it:
$b = 0^$
was transposed, should be:
$b = $^0


Benny69
(MM club member)
2010-08-09 01:39 AM
Re: KixGolf: Luhn's Mod - Public Round

Jochen,
I love this bit of code:
(($b - ($^) & 1) + 1)
fliping between 1 and 2, dang creative, you da man.


AllenAdministrator
(KiX Supporter)
2010-08-09 01:50 AM
Re: KixGolf: Luhn's Mod - Public Round

Interesting it doesn't work for you... works fine for me... using 4.61.

Benny69
(MM club member)
2010-08-09 01:53 AM
Re: KixGolf: Luhn's Mod - Public Round

yup, useing 4.61, transposed it works fine.

AllenAdministrator
(KiX Supporter)
2010-08-09 01:55 AM
Re: KixGolf: Luhn's Mod - Public Round

???? works either way for me... strange stuff.

Benny69
(MM club member)
2010-08-09 01:58 AM
Re: KixGolf: Luhn's Mod - Public Round

well i guess that is the way the Bits fall off the Byte ;\)

Bryce
(KiX Supporter)
2010-08-09 05:35 AM
Re: KixGolf: Luhn's Mod - Public Round

damn, here is my sherman tank (358) code...

 Code:
Function A($)

	
	dim $i, $x, $b, $l
	$l = len($)

	if $l = 15 or $l = 16
		redim $b[$l-1]
		for $i = 0 to $l-1
			$b[$i] = substr($,$i+1,1)
		next

		for $i = $l-2 to 0 step -2
			$x = 2*$b[$i]
			$b[$i] = iif($x>9,0+left($x,1) + right($x,1),$x)
		next

		$i = execute("$X="+join($b,'+'))
			
		if right($x,1) = 0
			$B = left($,1)
			if $b = 3
				if $l <> 15
					$b = 0
				endif
			else
				if instr('456',$b)
					if $l <> 16
						$b = 0
					endif	
				else
					$b = 0
				endif
			endif
		else
			$b = 0
		endif
	else
		$b = 0
	endif
	$a = $b


Endfunction


I never really got beyond the "can i even do it phase"


JochenAdministrator
(KiX Supporter)
2010-08-09 09:57 AM
Re: KixGolf: Luhn's Mod - Public Round

 Originally Posted By: Benny69
Jochen,
I love this bit of code:
(($b - ($^) & 1) + 1)
fliping between 1 and 2, dang creative, you da man.


Wahey Dale,
yeah, this was my last hope on sunday morning shaving further than 146 strokes, sparing one variable. But that turned out to be a dead end as I had to use much more parentheses than initially thought.
Here's what it looked like before:

 Code:
dim ... ,$b
...
    while $
        $b = ~$b
        $c = (2+$b) * right($,1)
        ....


So, there was no money in that either..



JochenAdministrator
(KiX Supporter)
2010-08-09 12:26 PM
Re: KixGolf: Luhn's Mod - Public Round

Borrowing the excellent idea Maciep had introducing into mine I would have had 140 .. Not that this would have changed the board but hey. I like the look of this

 Code:
function a($)
    dim $b, $c, $d
    $b = 0^$
    while $
        $c = (($b-($^) & 1)+1) * right($,1)
        $d = $d + $c-9*($c>9)
        $a = ($d mod 10 =) * ($>2&$<7&$b+($<4)=16) * $
        $ = left($,~)
endfunction


Funny how some things don't come to your mind when you stare at your own code for a week.


Benny69
(MM club member)
2010-08-09 02:13 PM
Re: KixGolf: Luhn's Mod - Public Round

here is Lonk's code at 133:

 Code:
Function A($b)
Dim $t,$,$x

For $t=0 to 99
 $=Right($b,1)
 $x=$t mod 2*((4<$)+$)+$+$x
 $b=Left($b,~)
 If $
  $a=($t=15-(3=$) & 2<$ & 7>$ & $x mod 10=)*$
EndFunction


Glenn BarnasAdministrator
(KiX Supporter)
2010-08-09 03:47 PM
Re: KixGolf: Luhn's Mod - Public Round

Back at the office - I can post my "179" code, with comments added
 Code:
Function A($)
  Dim $D,$F,$I,$S			; Digit, Flag, ID, Sum
  $A=0					; default return
  $D=Len($)				; CC # length
  $I=Left($,1)	;			; CC Issuer ID
  If ($D=15&$I=3)|$D=16&$I>3&$I<7	; verify ID/# Digits
    While $				; while digits
      $D=(1+$F)*Right($,1)		; Get digit and optionally double
      $S=$S+IIf($D>9,$D-9,$D)		; sum digit
      $F=$F^1				; flip odd/even flag
      $=Left($,~)			; trim string
    Loop
  ; common code
    If $S Mod 10 = 0			; if CC is valid
      $A=$I				; return issuer code
EndFunction
Glenn


AllenAdministrator
(KiX Supporter)
2010-08-09 04:20 PM
Re: KixGolf: Luhn's Mod - Public Round

I've never seen/noticed this before (added to my list of cheats) ... nice!

$F=$F^1 ; flip odd/even flag


DrillSergeant
(MM club member)
2010-08-09 05:10 PM
Re: KixGolf: Luhn's Mod - Public Round

starting to look a bit like my code ;\)

 Originally Posted By: Benny69
here is Lonk's code at 133:

 Code:
Function A($b)
Dim $t,$,$x

For $t=0 to 99
 $=Right($b,1)
 $x=$t mod 2*((4<$)+$)+$+$x
 $b=Left($b,~)
 If $
  $a=($t=15-(3=$) & 2<$ & 7>$ & $x mod 10=)*$
EndFunction


JochenAdministrator
(KiX Supporter)
2010-08-09 08:51 PM
Re: KixGolf: Luhn's Mod - Public Round

 Originally Posted By: Allen
I've never seen/noticed this before (added to my list of cheats) ... nice!

$F=$F^1 ; flip odd/even flag


If it had to be exactly 0 and 1 it'd be perfect. But we need to do (1+$f) before! in this loop..

So, as we can save one stroke (as shown a couple posts before) by doing:

$F=~$F (toggling between -1 and 0 and afterwards! doing (2+$f))

my version should enter your cheat book too ;\)

Edit: Aw, what the hell, here's my other version with 146:

 Code:
function a($)
    dim $b, $c, $d, $e
    $e = $^0
    while $
        $b = ~$b
        $d = (2+$b) * right($,1)
        $c = $c + $d-9*($d>9)
        $a = ($c mod 10 =) * (($e=15&$=3)|$e=16&$>3&$<7) * $
        $ = left($,~)
endfunction


See what I mean?


JochenAdministrator
(KiX Supporter)
2010-08-09 10:10 PM
Re: KixGolf: Luhn's Mod - Public Round

OMG!
I am such a dumbf***.
Why haven't I seen this on sunday morning

 Code:
function a($)
    dim $b, $d
    $b = 0^$
    while $
        $a = (($b-($^) & 1)+1) * right($,1)
        $d = $d + $a-9*($a>9)
        $a = ($d mod 10 =) * ($>2&$<7&$b+($<4)=16) * $
        $ = left($,~)
endfunction


= 137

and the same for my other version:

 Code:
function a($)
    dim $b, $c, $e
    $e = $^0
    while $
        $b = ~$b
        $a = (2+$b) * right($,1)
        $c = $c + $a-9*($a>9)
        $a = ($c mod 10 =) * ($>2&$<7&$e+($<4)=16) * $
        $ = left($,~)
endfunction


= 137 as well..


It_took_my_meds
(Hey THIS is FUN)
2010-08-10 08:59 AM
Re: KixGolf: Luhn's Mod - Public Round

I really enjoy seeing the ingenious solutions presented in KiXgolf.

@Drill - Wow, well done, I'm really impressed, I think your solution is fantastic!

@Allen - I'm glad you put on such a good challenge.

It's a pity Jen's didn't/couldn't play. It's such a selfless act to put on a challenge and it would have been good for him to finally get to play.

As for me, I've played a couple of times in the past but never did very well. I would have liked to have played this time but was away on holidays (skiing). I hope more challenges come, they really demonstrate the flexibility of KiXtart and I think they're great for helping good scripters learn advanced techniques.

Cheers,

Richard


LonkeroAdministrator
(KiX Master Guru)
2010-08-10 11:03 AM
Re: KixGolf: Luhn's Mod - Public Round

benny, damn. good catch!
that was stupid of me!


LonkeroAdministrator
(KiX Master Guru)
2010-08-10 11:55 AM
Re: KixGolf: Luhn's Mod - Public Round

129 out of mine:
 Code:
Function A($b)
Dim $t,$,$x

For $t=0 to 99
 $=0+Right($b,1)
 $x=1 & $t *($/5+$)+$+$x
 $b=Left($b,~)
 If $
  $a=(2<$ & 7>$ & $t=14+$/4 & $x mod 10=)*$
EndFunction


LonkeroAdministrator
(KiX Master Guru)
2010-08-10 06:09 PM
Re: KixGolf: Luhn's Mod - Public Round

WTF!!!!
122 out of mine.

 Code:
Function A($)
Dim $t,$x

For $t=0 to 15-($<4)
 $a=Right($,1)
 $x=1 & $t *(($a>4)+$a)+$a+$x
 $a=(2<$a & 7>$ & $x mod 10=)*$a
 $=Left($,~)
EndFunction


LonkeroAdministrator
(KiX Master Guru)
2010-08-10 06:35 PM
Re: KixGolf: Luhn's Mod - Public Round

119 out of drills code!
 Code:
Function A($)
Dim $c, $t

	For $c=0 to 15-($<4)
		$A = 0 + right($, 1)
		$t = 1 & $c * ($A / 5 + $A) + $A + $t
		$ = left($,~)
		If $t mod 10 + $ | 4&$A + 5
			$A = 0
Endfunction


AllenAdministrator
(KiX Supporter)
2010-08-11 12:05 AM
Re: KixGolf: Luhn's Mod - Public Round

I just can't wrap my mind around the following line...
Can you put this into words?

If $t mod 10 + $ | 4&$A + 5

"If it fails the Luhn check..."


LonkeroAdministrator
(KiX Master Guru)
2010-08-11 12:25 AM
Re: KixGolf: Luhn's Mod - Public Round

driller explained the 4&$A + 5, $t mod 10 makes sense too, right?
$ is any value left of the original value.
so:
if reminder + anyvalue_left or current_value smaller than 3 or greater than 6

the anyvalue_left reverts back to the for loop.
the loop goes 16 times (or 15, if left(input,1)=3)
if after that, any value is left to be processed => over length of input.

ok, hope that made any sense.


LonkeroAdministrator
(KiX Master Guru)
2010-08-11 12:27 AM
Re: KixGolf: Luhn's Mod - Public Round

oh, and in your words.
if it fails the check + is too long or is not acceptable card

I guess I could have used | instead of +
never even considered though.


LonkeroAdministrator
(KiX Master Guru)
2010-08-11 12:33 AM
Re: KixGolf: Luhn's Mod - Public Round

same tweak is sneaky in my code too, where:
$a=(2<$a & 7>$ ...

if currentvalue is more than 2 and currentval PLUS any reminder values is less than 7...


AllenAdministrator
(KiX Supporter)
2010-08-11 12:38 AM
Re: KixGolf: Luhn's Mod - Public Round

Thanks... truly amazing.

My mind just doesn't think that way. Is it any wonder I never really compete with you guys?


LonkeroAdministrator
(KiX Master Guru)
2010-08-11 01:36 AM
Re: KixGolf: Luhn's Mod - Public Round

well, I still don't fully crasp the kixtart binary logic. way too fuzzy.
kudos to drill about that. iirc hobie was one of those binary boys too.

but playing with numbers and making them dance for you... that I would consider my field \:\)


Richard H.Administrator
(KiX Supporter)
2010-08-11 09:46 AM
Re: KixGolf: Luhn's Mod - Public Round

I think that I've discovered the secret of the way Lonk's brain works:
 Originally Posted By: Jukka "Yucca" Korpela
I will conclude with a proof that Finnish has an infinite number of words. In Finnish, there is a derived word for any numeral, corresponding in meaning the words in the sequence simple, double, triple, etc. You take the numeral, make it one word, and append the word -kertainen possibly after some changes to the stem. Thus from tuhat viisi 1005 we get tuhatviisikertainen. And generally, there is the sequence of numerals yksinkertainen, kaksinkertainen, kolminkertainen and so on literally ad infinitum.


Taken from http://www.cs.tut.fi/~jkorpela/lang/vocab.html


BradV
(Seasoned Scripter)
2010-08-11 12:04 PM
Re: KixGolf: Luhn's Mod - Public Round

I can't even understand that! \:\)

DrillSergeant
(MM club member)
2010-08-11 12:59 PM
Re: KixGolf: Luhn's Mod - Public Round

 Originally Posted By: Lonkero
119 out of drills code!
 Code:
Function A($)
Dim $c, $t

	For $c=0 to 15-($<4)
		$A = 0 + right($, 1)
		$t = 1 & $c * ($A / 5 + $A) + $A + $t
		$ = left($,~)
		If $t mod 10 + $ | 4&$A + 5
			$A = 0
Endfunction


Damn! I don't think I even tried a for-next loop because I didn't believe it would be shorter.

Thanx for proving me wrong, you damn basta! ;-)


DrillSergeant
(MM club member)
2010-08-11 01:14 PM
Re: KixGolf: Luhn's Mod - Public Round

I'm not sure why it works, but... 114!

 Code:
; begin Luhns Mod
;
;!
Function A($)
Dim $c, $t

	For $c=0 to 15-($<4)
		$A = 0 + right($, 1)
		$t = 1 & $c * ($A / 5 + $A) + $A + $t
		$ = left($,~)
		If $t + $ | 4&$A + 5
			$A = 0
Endfunction


;!
;!
; end Luhns Mod


AllenAdministrator
(KiX Supporter)
2010-08-11 02:57 PM
Re: KixGolf: Luhn's Mod - Public Round

Maybe I'm wrong, but isn't $t supposed to be the sum total? Because it appears that $T is returning nothing but 0s and 1s... which just happen to always return the proper value for the luhn check in the end...

So are we missing a test or is this a Jedi Mind trick?


DrillSergeant
(MM club member)
2010-08-11 03:17 PM
Re: KixGolf: Luhn's Mod - Public Round

It is dark voodoo indeed...

If you put 1 & $c between round brackets and put the mod 10 back where it was you'll see that $T does indeed contain the total...

I noticed that when I removed the brackets I lost the value of $T but because the tests still came up as valid I went with it... and today I found out that it doesn't even need the mod 10 to work...


$T as expected:
 Code:
; begin Luhns Mod
;
;!
Function A($)
Dim $c, $t
	?
	For $c=0 to 15-($<4)
		$A = 0 + right($, 1)
		$t = (1 & $c) * ($A / 5 + $A) + $A + $t
		$ = left($,~)
		$t " "
		If $t mod 10 + $ | 4&$A + 5
			$A = 0
Endfunction


;!
;!
; end Luhns Mod


Voodoo $T:
 Code:
; begin Luhns Mod
;
;!
Function A($)
Dim $c, $t
	?
	For $c=0 to 15-($<4)
		$A = 0 + right($, 1)
		$t = 1 & $c * ($A / 5 + $A) + $A + $t
		$ = left($,~)
		$t " "
		If $t + $ | 4&$A + 5
			$A = 0
Endfunction


;!
;!
; end Luhns Mod


Or maybe I just sold my soul to the devil to win ;-)


AllenAdministrator
(KiX Supporter)
2010-08-11 03:48 PM
Re: KixGolf: Luhn's Mod - Public Round

I can completely see why the mod 10 check is unnecessary when you are getting the proper 0 or 1 value in $t... but how its doing this without a true total is a complete mystery to me.

So how hot is it down there? ;\)


JochenAdministrator
(KiX Supporter)
2010-08-11 05:04 PM
Re: KixGolf: Luhn's Mod - Public Round

 Originally Posted By: Lonkero
well, I still don't fully crasp the kixtart binary logic. way too fuzzy.
kudos to drill about that. iirc hobie was one of those binary boys too.

but playing with numbers and making them dance for you... that I would consider my field \:\)



Well, there are 10 guys who really understand KiXtart binary logic (Ruud not included), and these are Rogier and Howard M)

edit: on second thought make that 11 and add Richard to the list.
maybe even 100 including Remco


JochenAdministrator
(KiX Supporter)
2010-08-11 07:14 PM
Re: KixGolf: Luhn's Mod - Public Round

what?

 Code:
;pseudo:
if $t + $ | whateva
    $a = 0


I can't get why $t should be 0 in any case

edit: Maybe I don't want to know this.. there be dragons \:o


JochenAdministrator
(KiX Supporter)
2010-08-11 07:48 PM
Re: KixGolf: Luhn's Mod - Public Round

oh, I see .. Operator Precedence

1. ($a / 5 + $a)
2. + $a
3. + $t
4. * $c
5. 1 & (result of 1. - 4.)

Now that I just realized what might going on... how much time is left until the '19th Hole' ?

btw. Rogier: 4&$a+5 ... breathtaking move as well!


LonkeroAdministrator
(KiX Master Guru)
2010-08-11 08:44 PM
Re: KixGolf: Luhn's Mod - Public Round

nothing to do with voodoo.
the line:
$t = 1 & $c * ($A / 5 + $A) + $A + $t

is just the same as:
$t = 1 & ($c * ($A / 5 + $A) + $A + $t)

still trying to figure out what it does, but some day I will get to it ;\)


LonkeroAdministrator
(KiX Master Guru)
2010-08-11 09:30 PM
Re: KixGolf: Luhn's Mod - Public Round

somebody please comment but it actually looks like a "mod 2" statement.
but it is not. (tested it :))

anyhow... something is not cool in there.


Bryce
(KiX Supporter)
2010-08-11 10:20 PM
Re: KixGolf: Luhn's Mod - Public Round

ok, after looking at these.... damn. I was trying to rethink of a way to do everything in a single loop my self, but i just got back in town last night. So i had no real time to sit and think about it.


Nice job!


LonkeroAdministrator
(KiX Master Guru)
2010-08-12 05:11 AM
Re: KixGolf: Luhn's Mod - Public Round

bryce, funny cause when I started with this one, I didn't have a loop at all \:\)

LonkeroAdministrator
(KiX Master Guru)
2010-08-12 06:24 PM
Re: KixGolf: Luhn's Mod - Public Round

introducing new test case and leading score of 124

 Code:
Function A($)
Dim $t,$x

For $t=0 to 15-($<4)
 $a=Right($,1)
 $x=$t mod 2 *(($a>4)+$a)+$a+$x
 $a=(2<$a & 7>$ & $x mod 10=)*$a
 $=Left($,~)
EndFunction


test 64:
378282244310005=0


LonkeroAdministrator
(KiX Master Guru)
2010-08-12 06:25 PM
Re: KixGolf: Luhn's Mod - Public Round

and new leading score of 121

 Code:
Function A($)
Dim $c, $t

	For $c=0 to 15-($<4)
		$A = 0 + right($, 1)
		$t = $c mod 2 * ($A / 5 + $A) + $A + $t
		$ = left($,~)
		If $t mod 10 + $ | 4&$A + 5
			$A = 0
Endfunction


LonkeroAdministrator
(KiX Master Guru)
2010-08-12 06:32 PM
Re: KixGolf: Luhn's Mod - Public Round

and there was no voodoo involved.
it was all about too "linear" test cases.
drill's shortcut actually just did do what it was supposed to, test for 1 & x


DrillSergeant
(MM club member)
2010-08-12 07:50 PM
Re: KixGolf: Luhn's Mod - Public Round

Why Yes, mr Devil, I'm also willing to sign over my kidneys to you

119:

 Code:
; begin Luhns Mod
;
;!
Function A($)
Dim $c, $t

	For $c=0 to 15-($<4)
		$A = 0 + right($, 1)
		$t = $c mod 2 * ($A / 5 + $A) + $A + $t
		$ = left($,~)
		If $t mod 10 | 4&$A + 5
			$A = 0
Endfunction

;!
;!
; end Luhns Mod


LonkeroAdministrator
(KiX Master Guru)
2010-08-12 08:11 PM
Re: KixGolf: Luhn's Mod - Public Round

wtf. thought I tested that!

LonkeroAdministrator
(KiX Master Guru)
2010-08-12 08:23 PM
Re: KixGolf: Luhn's Mod - Public Round

k, one more test case and I'm back in the lead \:D

30378282246310005=0


LonkeroAdministrator
(KiX Master Guru)
2010-08-12 08:25 PM
Re: KixGolf: Luhn's Mod - Public Round

kinda weird competition this time :P

JochenAdministrator
(KiX Supporter)
2010-08-12 09:08 PM
Re: KixGolf: Luhn's Mod - Public Round

Refereeee!??!!11eleven

nB.: I guess I should face the facts for the public round. Work is too tough on Workdays (doing the stand-in for two colls in vacation) and my family life schedule will be too full this weekend.
So, I am looking forward to the next round which will hopefully start soon.


AllenAdministrator
(KiX Supporter)
2010-08-12 09:28 PM
Re: KixGolf: Luhn's Mod - Public Round

LOL... never seen a competition of who can come up with a test to break code like this before...

Sorry guys... I'll try to do better next time...

@Jochen... it could be a while before I'm ready for the next one... but the good news is, I have about 5 good ideas right now.


DrillSergeant
(MM club member)
2010-08-12 10:09 PM
Re: KixGolf: Luhn's Mod - Public Round

 Originally Posted By: Allen
LOL... never seen a competition of who can come up with a test to break code like this before...


NP Allen, it's happened before \:\)

We had this discussion in the past: should it follow the set of rules or just pass the given INI?

I believe we settled on following the rules, so a part of golf is indeed to come up with new tests that could break the other guys code, as long as you stay within the parameters of the assignment.


LonkeroAdministrator
(KiX Master Guru)
2010-08-12 11:28 PM
Re: KixGolf: Luhn's Mod - Public Round

yes. but the private code standings stay, if they passed those tests.

LonkeroAdministrator
(KiX Master Guru)
2010-08-14 09:16 AM
Re: KixGolf: Luhn's Mod - Public Round

glenn's at 149:
 Code:
Function A($D)
  Dim $,$F,$S				; Digit, Flag, ID, Sum
  $A=0
  $=Left($D,1)	;			; CC Issuer ID
  If ($D^)+($=3)=16 & $>2 & $<7 	; verify ID/# Digits
    While $D				; while digits
      $=Right($D,1)			; Get digit and optionally double
      $S=$S+$F*((4<$)+$)+$		; sum digit
      $F=$F^1				; flip odd/even flag
      $D=Left($D,~)			; trim string
      $A=($S Mod 10 =)*$		; if CC is valid
EndFunction


LonkeroAdministrator
(KiX Master Guru)
2010-08-14 10:01 AM
Re: KixGolf: Luhn's Mod - Public Round

132 from jochen's:
 Code:
function a($)
    dim $b, $d
    while $
        $a = right($,1)
        $d = $d + (1&$b)*((4<$a)+$a)+$a
	$b=$b+1
        $a = ($d mod 10 =) * ($>2&$<7&$b+($<4)=16) * $
        $ = left($,~)
endfunction


LonkeroAdministrator
(KiX Master Guru)
2010-08-14 10:31 AM
Re: KixGolf: Luhn's Mod - Public Round

damn, I love bryce's code! awesome! \:\)

didn't dare to do too much, just removed the if's. score: 250
 Code:
Function A($)

	
	dim $i, $x, $b, $l
	$l = len($)

		redim $b[$l-1]
		for $i = 0 to $l-1
			$b[$i] = substr($,$i+1,1)
		next

		for $i = $l-2 to 0 step -2
			$x = 2*$b[$i]
			$b[$i] = iif($x>9,0+left($x,1) + right($x,1),$x)
		next

		$i = execute("$X="+join($b,'+'))

	$a = ($>3 & $<7 & $l=16-($<4) & $x mod 10=)*left($,1)


LonkeroAdministrator
(KiX Master Guru)
2010-08-14 10:35 AM
Re: KixGolf: Luhn's Mod - Public Round

hmm...
I guess everyone has given up already.

current (unofficial!) standings on public would then be something like:
Lonkero - 121 (based on drill)
Benny - 133 (based on Lonk)
Maciep - 137 (own from private)
Jochen - 137 (own from private, improved)
Glenn - 179 (own from private)
BradV - 262 (own from private)
Bryce - 358 (own from private)


LonkeroAdministrator
(KiX Master Guru)
2010-08-14 10:45 AM
Re: KixGolf: Luhn's Mod - Public Round

another stap and bryce's code. commenting changes.
237
 Code:
Function A($)	
	$a = $^0 ;no need for long keywords like len()
	dim $i, $x, $b[$a-1] ;$l removed using $a instead
	
		;redim $b[$a-1] ;no need to redim if doing right in the start ;)
		for $i = 0 to $a-1
			$b[$i] = substr($,$i+1,1)
		next

		for $i = $a-2 to 0 step -2
			$x = 2*$b[$i]
			$b[$i] = iif($x>9,0+left($x,1) + right($x,1),$x)
		next

		$i = execute("$X="+join($b,'+'))

	$a = ($>3 & $<7 & $a=16-($<4) & $x mod 10=)*left($,1)
Endfunction


LonkeroAdministrator
(KiX Master Guru)
2010-08-14 10:57 AM
Re: KixGolf: Luhn's Mod - Public Round

yet another stap at bryce's code. commenting changes.
211
 Code:
Function A($)	
	$a = $^0 ;no need for long keywords like len()
	dim $i, $x, $b[$a-1] ;$l removed using $a instead
	
		;redim $b[$a-1] ;no need to redim if doing right in the start ;)
		for $i = 0 to $a-1
			$b[$i] = substr($,$i+1,1)
		next

		for $i = $a-2 to 0 step -2
			$x = 2*$b[$i]
			; $b[$i] = iif($x>9,0+left($x,1) + right($x,1),$x) redone without lettercode (right replaced with mod).
			;$b[$i] = iif($x>9,0+left($x,1) + $x mod 10,$x) x cannot be more than 18, so removing left(). also removing iif.
			$b[$i] = $x-9*($x>9)
		next

		$i = execute("$X="+join($b,'+'))

	$a = ($>3 & $<7 & $a=16-($<4) & $x mod 10=)*left($,1)
Endfunction


LonkeroAdministrator
(KiX Master Guru)
2010-08-14 11:12 AM
Re: KixGolf: Luhn's Mod - Public Round

still going at it. for documentation purposes, posting before continuing.
210
 Code:
Function A($)	
	$a = $^0 ;no need for long keywords like len()
	dim $i, $x, $b[$a-1],$s ;$l removed using $a instead. $s introduced as "swinger"
	
		;redim $b[$a-1] ;no need to redim if doing right in the start ;)
		for $i = $a-1 to 0 step -1
			$x = substr($,$i+1,1)
			if $s ;second for loop removed. using swinger swapper instead.
				$x = 2*$x
				$x = $x-9*($x>9)
			endif
			$b[$i] = $x
			$s=$s^1
		next

		$i = execute("$X="+join($b,'+'))

	$a = ($>3 & $<7 & $a=16-($<4) & $x mod 10=)*left($,1)
Endfunction


LonkeroAdministrator
(KiX Master Guru)
2010-08-14 11:45 AM
Re: KixGolf: Luhn's Mod - Public Round

still going at it. for documentation purposes, posting before continuing.
203
 Code:
Function A($)	
	$a = $^0
	dim $i, $x, $b[$a-1],$s
	
		for $i = $a-1 to 0 step -1
			$x = substr($,$i+1,1)
			if $s
				;$x = 2*$x
				;$x = $x-9*($x>9)
				$x = 2*$x+(4<$x) ; above lines combined
			endif
			$b[$i] = $x
			$s=$s^1
		next

		$i = execute("$X="+join($b,'+'))

		$a = ($>3 & $<7 & $a=16-($<4) & $x mod 10=)*left($,1)
Endfunction


LonkeroAdministrator
(KiX Master Guru)
2010-08-14 11:45 AM
Re: KixGolf: Luhn's Mod - Public Round

bryce's 195
 Code:
Function A($)	
	$a = $^0
	dim $i, $x, $b[$a-1],$s
	
		for $i = $a-1 to 0 step -1
			$x = substr($,$i+1,1)
;			if $s
;				$x = 2*$x+(4<$x)
;			endif
			$b[$i] = $s*((4<$x)+$x)+$x ;replaces the commented out if statement
			$s=$s^1
		next

		$i = execute("$X="+join($b,'+'))

		$a = ($>3 & $<7 & $a=16-($<4) & $x mod 10=)*left($,1)
Endfunction


LonkeroAdministrator
(KiX Master Guru)
2010-08-14 12:01 PM
Re: KixGolf: Luhn's Mod - Public Round

bryce's at 189
 Code:
Function A($)	
	$a = $^0
	dim $i, $x, $b[$a-1],$s

;		for $i = $a-1 to 0 step -1 too long. fixing.
		for $i = -$a to -1
			$x = substr($,-$i,1)
			$b[~$i] = $s*((4<$x)+$x)+$x
			$s=$s^1
		next

		$i = execute("$X="+join($b,'+'))
		$a = ($>3 & $<7 & $a=16-($<4) & $x mod 10=)*left($,1)
Endfunction


LonkeroAdministrator
(KiX Master Guru)
2010-08-14 12:54 PM
Re: KixGolf: Luhn's Mod - Public Round

I AM HAVING TOO MUCH FUN!

120, new leader again :P

 Code:
Function A($)
Dim $c, $t

	For $c=0 to 15-($<4)
		$A = 0 + right($, 1)
		$t = (1&$c) * (1.1*$A) + $A + $t
		$ = left($,~)
		If $t mod 10 + $ | 4&$A + 5
			$A = 0
Endfunction


LonkeroAdministrator
(KiX Master Guru)
2010-08-14 12:57 PM
Re: KixGolf: Luhn's Mod - Public Round

the same "trick" brings "mine" to 121

 Code:
Function A($)
Dim $t,$x

For $t=0 to 15-($<4)
 $a=Right($,1)
 $x=(1&$t) *(1.1*$a)+$a+$x
 $a=(2<$a & 7>$ & $x mod 10=)*$a
 $=Left($,~)
EndFunction


LonkeroAdministrator
(KiX Master Guru)
2010-08-14 01:03 PM
Re: KixGolf: Luhn's Mod - Public Round

how stupid of me.
my code is at 120 as well.
 Code:
Function A($)
Dim $t,$x

For $t=0 to 15-($<4)
 $a=Right($,1)
 $x=(1&$t) *(1.1*$a)+$a+$x
 $a=(2<$ & 7>$ & $x mod 10=)*$a
 $=Left($,~)
EndFunction


LonkeroAdministrator
(KiX Master Guru)
2010-08-14 01:38 PM
Re: KixGolf: Luhn's Mod - Public Round

118
 Code:
Function A($)
Dim $c, $t

	For $c=0 to 15-($<4)
		$A = 0 + right($, 1)
		$t = $A + 1.1*$A*(1&$c) + $t
		$ = left($,~)
		If $t mod 10 + $ | 4&$A + 5
			$A = 0
Endfunction


AllenAdministrator
(KiX Supporter)
2010-08-14 02:00 PM
Re: KixGolf: Luhn's Mod - Public Round

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


AllenAdministrator
(KiX Supporter)
2010-08-14 02:10 PM
Re: KixGolf: Luhn's Mod - Public Round

 Quote:

By the way, this is another sneaky move too:

($A / 5 + $A)

If $A is a digit of 5 or greater, you need to add the two digits to get the relevant single digit number.

The calculation above doesn't do that, but just adds another 1 if the number is 5 or greater. This will give:

5 + 5 = 10 + 1(because of $A/5) = 11`
6 + 6 = 12 + 1 = 13
7 + 7 = 14 + 1 = 15

Now for the check if it's divisble by 10 it doesn't matter if you add another extra 10 to the total, so I had the same calculation as Eric, (-9 * ($A>4)) but replaced that (also today) for the calculation above.


I finally see it! \:\) That is so slick and using the 1.1 is just a shortcut of Drills... very nice guys.


AllenAdministrator
(KiX Supporter)
2010-08-14 02:13 PM
Re: KixGolf: Luhn's Mod - Public Round

@Lonk... if you'll fix that code so it has the function line and dims, I'll try it with 4.61

LonkeroAdministrator
(KiX Master Guru)
2010-08-14 03:07 PM
Re: KixGolf: Luhn's Mod - Public Round

oops. sorry. fixed.

LonkeroAdministrator
(KiX Master Guru)
2010-08-14 03:08 PM
Re: KixGolf: Luhn's Mod - Public Round

and I refuse to admit 1.1 is shortcut of drill's as my code used similar logic ;\)


LonkeroAdministrator
(KiX Master Guru)
2010-08-14 03:34 PM
Re: KixGolf: Luhn's Mod - Public Round

k, not sure what I missed with the above code, but I promise you, I got error on line 1 or 9 with it.

AllenAdministrator
(KiX Supporter)
2010-08-14 06:09 PM
Re: KixGolf: Luhn's Mod - Public Round

It worked... but failed the tester...

 Code:
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


Bryce
(KiX Supporter)
2010-08-14 06:41 PM
Re: KixGolf: Luhn's Mod - Public Round

 Originally Posted By: Lonkero
bryce's at 189
 Code:
Function A($)	
	$a = $^0
	dim $i, $x, $b[$a-1],$s

;		for $i = $a-1 to 0 step -1 too long. fixing.
		for $i = -$a to -1
			$x = substr($,-$i,1)
			$b[~$i] = $s*((4<$x)+$x)+$x
			$s=$s^1
		next

		$i = execute("$X="+join($b,'+'))
		$a = ($>3 & $<7 & $a=16-($<4) & $x mod 10=)*left($,1)
Endfunction


damn lonk! that is truly amazing i can tell you i would have never gotten my code to that.


LonkeroAdministrator
(KiX Master Guru)
2010-08-14 07:38 PM
Re: KixGolf: Luhn's Mod - Public Round

oh. wasn't done with it just yet though :P

LonkeroAdministrator
(KiX Master Guru)
2010-08-14 09:43 PM
Re: KixGolf: Luhn's Mod - Public Round

yeah...
removing the need for array is the next step and then it becomes pretty close already to the other ones. 177.
 Code:
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
 Code:
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


LonkeroAdministrator
(KiX Master Guru)
2010-08-14 09:51 PM
Re: KixGolf: Luhn's Mod - Public Round

still, redoing bryce's...
145
 Code:
Function A($)
	dim $i, $x, $b,$s

		for $i = -($^) to -1
			$x = substr($,-$i,1)
			$b = $b+$s*((4<$x)+$x)+$x
			$s=$s^1
			$a = ($>3 & $<7 & ($^)=16-($<4) & $b mod 10=)*left($,1)
Endfunction


LonkeroAdministrator
(KiX Master Guru)
2010-08-14 10:14 PM
Re: KixGolf: Luhn's Mod - Public Round

bryce's down to 138
 Code:
Function A($)
	dim $i, $x, $b,$s

		for $i = -($^) to -1
			$x = substr($,-$i,1)
			$b = $b+$s*((4<$x)+$x)+$x
			$s=$s^1
			$a = ($>3 & $<7 & ($^)=16-($<4) & $b mod 10=)*$x
Endfunction


LonkeroAdministrator
(KiX Master Guru)
2010-08-15 02:18 AM
Re: KixGolf: Luhn's Mod - Public Round

so...
do we have all of 15th to code or will it end when we reach 7 days?


AllenAdministrator
(KiX Supporter)
2010-08-15 05:53 AM
Re: KixGolf: Luhn's Mod - Public Round

It ends at 12:00 US eastern time.. about 12 hours from now.

LonkeroAdministrator
(KiX Master Guru)
2010-08-15 05:26 PM
Re: KixGolf: Luhn's Mod - Public Round

us eastern time?
you mean EST or EDT or something else?


LonkeroAdministrator
(KiX Master Guru)
2010-08-15 05:28 PM
Re: KixGolf: Luhn's Mod - Public Round

end is anyways in 32 mins, right?

AllenAdministrator
(KiX Supporter)
2010-08-15 06:06 PM
Re: KixGolf: Luhn's Mod - Public Round

Something like that... it's officially over now.

LonkeroAdministrator
(KiX Master Guru)
2010-08-15 06:18 PM
Re: KixGolf: Luhn's Mod - Public Round

wohoo. someone didn't get any score from public! yehaa. :p

LonkeroAdministrator
(KiX Master Guru)
2010-08-15 06:58 PM
Re: KixGolf: Luhn's Mod - Public Round

thanks for the fun thought, to all of you!
specially thanks allen for hosting and drill for making it challenging!


AllenAdministrator
(KiX Supporter)
2010-08-15 07:04 PM
Re: KixGolf: Luhn's Mod - Public Round

I've sent an email to Jens asking for some clarification of scoring... I'll post the scores as soon as I hear back from him.

AllenAdministrator
(KiX Supporter)
2010-08-15 08:22 PM
Re: KixGolf: Luhn's Mod - Public Round

With my interpretation of the rules...
Private Round Scoring				
			Particip.	
Name	Score	Points	Points	Total
Drill	124	5	1	6
Lonkero	132	4	1	5
Maciep	137	3	1	4
Jochen	146	2	1	3
Glenn	179	1	1	2
Benny69	185	0	1	1
Brad	262	0	1	1
Bryce	358	0	1	1
 
Public Round Scoring Bonus Name Score Points Points Total Lonkero 118 5 1 6 Benny69 133 4 1 5 Jochen 137 2.5 1 3.5 Maciep 137 2.5 0 2.5 Glenn 179 1 0 1 Brad 262 0 0 0 Bryce 358 0 0 0 Drill failed public 0 0 0
Final Scoring Lonkero 11 Jochen 6.5 Maciep 6.5 Drill 6 Benny 6 Glenn 2 Brad 1 Bryce 1


LonkeroAdministrator
(KiX Master Guru)
2010-08-15 08:28 PM
Re: KixGolf: Luhn's Mod - Public Round

I must disagree with the ruling.
only the codes that get a succesfull score within public round that passes all the testing, even the new ones, are egilible for points.


AllenAdministrator
(KiX Supporter)
2010-08-15 09:00 PM
Re: KixGolf: Luhn's Mod - Public Round

I had to assume you were protesting Drills 124... I didn't realize it failed the public tests... please be a little clearer on your future protests.

The management ;\)

Scores updated above.


LonkeroAdministrator
(KiX Master Guru)
2010-08-15 11:30 PM
Re: KixGolf: Luhn's Mod - Public Round

lol. awesome.

AllenAdministrator
(KiX Supporter)
2010-08-16 04:43 AM
Re: KixGolf: Luhn's Mod - Public Round

Jooel... No more protest? Are you censoring yourself now? \:\)

LonkeroAdministrator
(KiX Master Guru)
2010-08-16 07:01 AM
Re: KixGolf: Luhn's Mod - Public Round

well... not censoring. decided to sleep for a bit.

LonkeroAdministrator
(KiX Master Guru)
2010-08-16 07:08 AM
Re: KixGolf: Luhn's Mod - Public Round

hmm... not a protest but reading the rules, I think you found an old scoring engine. it didn't work with block comments ;\)

but again, thanks for the fun allen.


Sealeopard
(KiX Master)
2010-08-20 06:04 AM
Re: KixGolf: Luhn's Mod - Public Round

How do you get half points?

AllenAdministrator
(KiX Supporter)
2010-08-20 06:30 AM
Re: KixGolf: Luhn's Mod - Public Round

By dividing by 2.

Richard H.Administrator
(KiX Supporter)
2010-08-20 08:45 AM
Re: KixGolf: Luhn's Mod - Public Round

I though maybe it was a rounding error \:\/

Maybe the next challenge should be the KiXgolf scoring engine - the Ouroboros challenge.