#191653 - 2009-01-06 01:16 AM
Re: KiXgolf: Latin Squares - public round
[Re: Lonkero]
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
341
; begin KiXgolfUDF
;
;!
Function S($o)
Dim $i, $, $k, $t, $x, $v, $p
For $x = 0 to 16
ReDim $r[3], $c[3], $q[3], $s[3, 3, $x]
For $ = 0 to 7
For $i = 0 to 3
$v = $o[$ mod 4, $i]
$k = 3-2*($ mod 4 <2)-($i<2)
If $ < 4
$r[$i] = $r[$i] + $v
$c[$] = $c[$] + $v
$q[$k] = $q[$k] + $v
$s[$, $i, $x] = $v
Else
If 0 > AScan($r,x,,,1)
Exit
Else
$p = @
For $t = 1 to 4
If 0 = InStr($c[$-4]+$r[$i]+$q[$k],$t) + $v
$p = $p + $t
EndIf
Next
If 1=($p^)
$o[$-4,$i] = $p
$ = 7
$i = 3
EndFunction
;!
;!
; end KiXgolfUDF
_________________________
!download KiXnet
|
Top
|
|
|
|
#191657 - 2009-01-06 02:02 AM
Re: KiXgolf: Latin Squares - public round
[Re: Lonkero]
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
Dang! I was looking at that but just could not see it!
|
Top
|
|
|
|
#191693 - 2009-01-07 03:19 PM
Re: KiXgolf: Latin Squares - public round
[Re: Lonkero]
|
DrillSergeant
MM club member
Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
|
Let's continue...338
Your solution passed all tests
KiXtart
KiXtart Version = 4.60
KiXGolf Script = kixgolf_ls.KIX
Computer
OS = Windows XP Professional
CPU = Intel(R) Pentium(R) D CPU 2.80GHz
Speed = 2793 MHz
Memory = 1008 MB
KiXGolf Scoring Engine
Scoring Engine = 3.3
KiXtart Golf Score
Tournament = Latin Squares
Processing Start = 2009/01/07 15:16:38.304
Processing End = 2009/01/07 15:16:38.508
Duration = 0000/00/00 00:00:00.204
KiXGolf Score = 338
Thank you for participating in KiXtart Golf!
; begin KiXgolfUDF
;
;!
Function S($o)
Dim $i, $, $k, $t, $x, $v, $p
For $x = 0 to 16
ReDim $s[3, 3, $x], $r[11]
For $ = 0 to 7
For $i = 0 to 3
$v = $o[$ mod 4, $i]
$k = 3-2*($ mod 4 <2)-($i<2)
If $ < 4
$r[$i] = $r[$i] + $v
$r[4+$] = $r[4+$] + $v
$r[8+$k] = $r[8+$k] + $v
$s[$, $i, $x] = $v
Else
If 0 > AScan($r,x,,,1)
Exit
Else
$p = @
For $t = 1 to 4
If 0 = InStr($r[$]+$r[$i]+$r[8+$k],$t) + $v
$p = $p + $t
EndIf
Next
If 1=($p^)
$o[$-4,$i] = $p
$ = 7
$i = 3
EndFunction
;!
;!
; end KiXgolfUDF
_________________________
The Code is out there
|
Top
|
|
|
|
#191694 - 2009-01-07 03:22 PM
Re: KiXgolf: Latin Squares - public round
[Re: DrillSergeant]
|
DrillSergeant
MM club member
Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
|
333
;begin KiXgolfUDF
;
;!
Function S($o)
Dim $i, $, $k, $t, $x, $v, $p
For $x = 0 to 16
ReDim $s[3, 3, $x], $r[11]
For $ = 0 to 7
For $i = 0 to 3
$v = $o[$ mod 4, $i]
$k = 11-2*($ mod 4 <2)-($i<2)
If $ < 4
$r[$i] = $r[$i] + $v
$r[4+$] = $r[4+$] + $v
$r[$k] = $r[$k] + $v
$s[$, $i, $x] = $v
Else
If 0 > AScan($r,x,,,1)
Exit
Else
$p = @
For $t = 1 to 4
If 0 = InStr($r[$]+$r[$i]+$r[$k],$t) + $v
$p = $p + $t
EndIf
Next
If 1=($p^)
$o[$-4,$i] = $p
$ = 7
$i = 3
EndFunction
;!
;!
; end KiXgolfUDF
_________________________
The Code is out there
|
Top
|
|
|
|
#191697 - 2009-01-07 04:30 PM
Re: KiXgolf: Latin Squares - public round
[Re: DrillSergeant]
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
Dang! I am just too slow, I have been looking at those vars for 2 days trying to come up with a way to reduce them, you Dawg!
|
Top
|
|
|
|
#191711 - 2009-01-07 10:53 PM
Re: KiXgolf: Latin Squares - public round
[Re: Lonkero]
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
YEHAA!
332!
Function S($o)
Dim $i, $, $k, $t, $x, $v, $p,$r
For $x = 0 to 16
If instr(join($),x) | $x=0
ReDim $s[3, 3, $x], $[11]
For $r = 0 to 7
For $i = 0 to 3
$v = $o[$r mod 4, $i]
$k = 11-2*($r mod 4 <2)-($i<2)
If $r < 4
$[$i] = $[$i] + $v
$[4+$r] = $[4+$r] + $v
$[$k] = $[$k] + $v
$s[$r, $i, $x] = $v
Else
$p = @
For $t = 1 to 4
If 0 = InStr($[$r]+$[$i]+$[$k],$t) + $v
$p = $p + $t
EndIf
Next
If 1=($p^)
$o[$r-4,$i] = $p
$r = 7
$i = 3
EndFunction
that move of the x-check doesn't benefit. I just hated seeing that darn exit command in there
_________________________
!download KiXnet
|
Top
|
|
|
|
#191747 - 2009-01-10 05:32 AM
Re: KiXgolf: Latin Squares - public round
[Re: Lonkero]
|
Sealeopard
KiX Master
Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
|
Private Round
Player |
Score |
Points |
DrillSergeant |
405 |
5 |
Public Round
Player |
Score |
Points |
Lonkero |
332 |
5 |
DrillSergeant |
333 |
4 |
Benny69 |
348 |
3 |
Totals
Player |
Score |
Participation |
Private |
Public |
Grand |
Private |
Public |
Bonus |
Bonus |
Points |
Points |
Totals |
DrillSergeant |
405 |
333 |
1 |
1 |
5 |
4 |
11 |
Lonkero |
N/A |
332 |
1 |
0 |
0 |
5 |
6 |
Benny69 |
N/A |
348 |
1 |
0 |
0 |
3 |
4 |
- 1 Point for each participant that posts a KiXgolf script during the
public coding round (must be either a new solution or an improvement to an
existing solution)
- x Points for 1st to 5th place in either the private or public round in
reverse order, thus 1st Place = 5 points down to 5th Place = 1 Point
- 1 Point for all participants in the private coding round (results posted
in private round and valid script posted in public round)
_________________________
There are two types of vessels, submarines and targets.
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 525 anonymous users online.
|
|
|