#187112 - 2008-04-20 09:05 AM
Re: KiXgolf 2008 Schmankerl: Check Scanning
[Re: Sealeopard]
|
RemcovC
Starting to like KiXtart
Registered: 2006-09-13
Posts: 174
Loc: Holland
|
I don't see a new topic for public round so I wil post my code here to celebrate your 24th, 25th, 26th, and 27th post
Function a($)
Dim $b, $d, $f, $g, $h, $i, $k[9], $t, $x, $y, $z $b = "._.|.||_|",".....|..|","._.._||_.","._.._|._|","...|_|..|","._.|_.._|","._.|_.|_|","._...|..|","._.|_||_|","._.|_|._|" For $a = 0 To 8 $f = "" For $z = 0 To 2 $f = $f + SubStr($[$z], $a * 3 + 1, 3) Next $k[$a]=AScan($b, $f) Next $g = Ascan($k,~) $a = failure For $t = 0 to 8 If $g = $t ^ $g = -1 $i = "" For $x = 0 to 9 $f = 1 For $z = 0 to 8 If SubStr($b[$x], $z+1, 1) = "." & SubStr($[$z/3], $z mod 3 + $t * 3 + 1, 1) > "." $f = 0 EndIf Next If $f $i = $i + $x EndIf Next For $z = 1 to $i^0 $f = "" $x = 0 For $d = 0 to 8 $y = IIf($t = $d, SubStr($i,$z,1), $k[$d]) $x = $x + (9 - $d) * $y $f = $f + $y Next If $x mod 11 = 0 $a = Iif($a>Z, $f, ambiguous) EndFunction
Edit added spoiler
Edited by RemcovC (2008-04-20 12:58 PM)
_________________________
It's better to have scripted and died, then to never have scripted at all
|
Top
|
|
|
|
#187118 - 2008-04-20 09:22 PM
Re: KiXgolf 2008 Schmankerl: Check Scanning
[Re: Sealeopard]
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
Top
|
|
|
|
#187123 - 2008-04-21 05:21 AM
Re: KiXgolf 2008 Schmankerl: Check Scanning
[Re: Les]
|
cj
MM club member
Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
|
Use the tags (spoiler) text here... (/spoiler), replacing the round brackets with square and/or use the spoiler button on the toolbar, or both. The button is an S with a / through it, 9th from the left.
come here, where did I put that fish..
cj
|
Top
|
|
|
|
#187157 - 2008-04-22 09:31 AM
Re: KiXgolf 2008 Schmankerl: Check Scanning
[Re: RemcovC]
|
DrillSergeant
MM club member
Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
|
-k-
I'm on the bandwagon... I've still got no clue what Remco's script does exactly, but I've put in a split, removed an unused var and made the best use of the $ var:
Your solution passed all tests
KiXtart KiXtart Version = 4.60 KiXGolf Script = kixgolf_cs.KIX
KiXGolf Scoring Engine Scoring Engine = 3.3
KiXtart Golf Score Tournament = Check Scanning Processing Start = 2008/04/22 09:30:55.900 Processing End = 2008/04/22 09:30:55.990 Duration = 0000/00/00 00:00:00.089 KiXGolf Score = 544 Thank you for participating in KiXtart Golf!
; begin Check Scanning ; ;!
Function a($r)
Dim $b, $d, $, $g, $i, $k[9], $t, $x, $y, $z $b = split("._.|.||_| .....|..| ._.._||_. ._.._|._| ...|_|..| ._.|_.._| ._.|_.|_| ._...|..| ._.|_||_| ._.|_|._|") For $a = 0 To 8 $ = "" For $z = 0 To 2 $ = $ + SubStr($r[$z], $a * 3 + 1, 3) Next $k[$a]=AScan($b, $) Next $g = Ascan($k,~) $a = failure For $t = 0 to 8 If $g = $t ^ $g = -1 $i = "" For $x = 0 to 9 $ = 1 For $z = 0 to 8 If SubStr($b[$x], $z+1, 1) = "." & SubStr($r[$z/3], $z mod 3 + $t * 3 + 1, 1) > "." $ = 0 EndIf Next If $ $i = $i + $x EndIf Next For $z = 1 to $i^0 $ = "" $x = 0 For $d = 0 to 8 $y = IIf($t = $d, SubStr($i,$z,1), $k[$d]) $x = $x + (9 - $d) * $y $ = $ + $y Next If $x mod 11 = 0 $a = Iif($a>Z, $, ambiguous) ; Endif ; Next ; EndiF ; Next EndFunction
;! ;! ; end Check Scanning
Now, let's see if I can figure out what the heck this stuff does...
Edited by DrillSergeant (2008-04-22 09:33 AM)
_________________________
The Code is out there
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 447 anonymous users online.
|
|
|