#180500 - 2007-09-13 02:41 AM
Re: KiXgolf: A-to-Z - Public Round
[Re: Sealeopard]
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
ok here is my 218 code:
; begin A-to-Z
;
;!
Function a($b,$c)
Dim $,$d,$e
$a=0
For Each $ in $b
Dim $f
For Each $d in $b
If $<$d
For $e = $d^0 to 2 Step -1
If $=$c[0]+Left(Right($,~),~)+$c[1] & ($^)-$f<$a | ~$a
$a=($^)-$f
$a=''+$a+' '+$
Else
If Right($,$e)=Left($d,$e)
$=$+' '+$d
$f=$f+$e+1
; EndIf
; EndIf
; Next
; EndIf
; Next
; Next
EndFunction
;!
;!
; end A-to-Z
|
Top
|
|
|
|
#180501 - 2007-09-13 03:27 AM
Re: KiXgolf: A-to-Z - Public Round
[Re: Benny69]
|
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4545
Loc: USA
|
; EndIf
; EndIf
; Next
; EndIf
; Next
; Next
-27 Right there... You gotta love that.
Nice job Dale.
|
Top
|
|
|
|
#180502 - 2007-09-13 04:13 AM
Re: KiXgolf: A-to-Z - Public Round
[Re: Allen]
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
|
Top
|
|
|
|
#180504 - 2007-09-13 07:26 AM
Re: KiXgolf: A-to-Z - Public Round
[Re: Benny69]
|
DrillSergeant
MM club member
Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
|
Here's my 267:
; begin A-to-Z
;
;!
Function a($l,$t)
dim $, $i, $j, $k, $m, $h
$h = $l
$a=0
For each $i in $l
For $j = 0 to UBound($l)
$ = $l[$j]
For $k = 0 to ($^)-1
If Substr($,$k+1) = Left($i,($^)-$k)
If $k
$h[$j] = $h[$j] + ' ' + $i
EndIf
$ = Left($,$k) + $i
$l[$j] = $
If Left($,1) = $t[0] & Right($,1) = $t[1] & $m>($^) | $m=0
$m = $^0
$a = '' + $m +' '+ $h[$j]
EndFunction
;!
;!
; end A-to-Z
Love your code benny! With that low score I thought you'd do some recursion magic or something. This is very clean and efficient!
_________________________
The Code is out there
|
Top
|
|
|
|
#180506 - 2007-09-13 09:03 AM
Re: KiXgolf: A-to-Z - Public Round
[Re: Benny69]
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
Funny thing is, and I don't know if you two have realized, that if you change a test case with 3 resulting words to something like this,our codes will all fail miserably
[Test 8] Dictionary=ones,about,other,ideas,outside,against,students,added,education Input=a,s Output=11 about outside ideas
_________________________
|
Top
|
|
|
|
#180508 - 2007-09-13 11:04 AM
Re: KiXgolf: A-to-Z - Public Round
[Re: Jochen]
|
DrillSergeant
MM club member
Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
|
Funny thing is, and I don't know if you two have realized, that if you change a test case with 3 resulting words to something like this,our codes will all fail miserably <pre> [Test 8] Dictionary=ones,about,other,ideas,outside,against,students,added,education Input=a,s Output=11 about outside ideas </pre>
Jochen, what do you mean? My code works fine with this test-case
_________________________
The Code is out there
|
Top
|
|
|
|
#180523 - 2007-09-13 01:07 PM
Re: KiXgolf: A-to-Z - Public Round
[Re: Jochen]
|
DrillSergeant
MM club member
Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
|
you sure? I've tested with this ini:
[Test 1]
Dictionary=ones,against,students,about,outside,other,ideas,added,education
Input=a,s
Output=11 about outside ideas
[Test 2]
Dictionary=ones,against,students,about,outside,other,ideas,added,education
Input=o,s
Output=4 ones
[Test 3]
Dictionary=ones,against,students,about,outside,other,ideas,added,education
Input=o,t
Output=0
[Test 4]
Dictionary=aaabb,aabbbb,bbbbz,abc,aza
Input=a,z
Output=7 aabbbb bbbbz
[Test 5]
Dictionary=aaabb,aabbbb,bbbbz,abc,az
Input=z,a
Output=0
[Test 6]
Dictionary=able,lemmings,leeway,ayrton,senna,ayse,selfish,onset,short
Input=a,t
Output=9 ayrton onset
[Test 7]
Dictionary=kixtart,kixgolf,kixforms,script,editor,fun,tart,kita,lordi,halo
Input=k,t
Output=6 kita tart
[Test 8]
Dictionary=ones,outside,other,ideas,against,students,added,education,about
Input=a,s
Output=11 about outside ideas
_________________________
The Code is out there
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 515 anonymous users online.
|
|
|