Page 1 of 4 1234>
Topic Options
#180499 - 2007-09-13 01:41 AM KiXgolf: A-to-Z - Public Round
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Please post your code. Initial private round ranking to follow shortly.
_________________________
There are two types of vessels, submarines and targets.

Top
#180500 - 2007-09-13 02:41 AM Re: KiXgolf: A-to-Z - Public Round [Re: Sealeopard]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
ok here is my 218 code:

 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
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#180501 - 2007-09-13 03:27 AM Re: KiXgolf: A-to-Z - Public Round [Re: Benny69]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
 Code:
;						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 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
thanks pal
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#180504 - 2007-09-13 07:26 AM Re: KiXgolf: A-to-Z - Public Round [Re: Benny69]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Here's my 267:
 Code:
; 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
#180505 - 2007-09-13 07:48 AM Re: KiXgolf: A-to-Z - Public Round [Re: Sealeopard]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Here is my 234 (worth -28 on closing keywords)



function a($b,$c)
    dim $,$d,$e
    $a=0
    for each $ in $b
        if left($,1)=$c[0]
            dim $f
            for each $d in $b
                dim $g
                for $e=2 to 0|$
                    if instr($d,right($,$e))=1
                        $g=$e
                    endif
                next
                if $g
                    if $d<>$
                        $f=$f+$g+1
                        $=$+' '+$d
                    endif
                    if right($,1)=$c[1]
                        $g=($|)-$f
                        if $g<$a|1>$a
                            $a=''+$g+' '+$
endfunction

_________________________



Top
#180506 - 2007-09-13 09:03 AM Re: KiXgolf: A-to-Z - Public Round [Re: Benny69]
Jochen Administrator Offline
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
#180507 - 2007-09-13 09:12 AM Re: KiXgolf: A-to-Z - Public Round [Re: Jochen]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Here is mine a bit rearranged:


; begin A-to-Z
;
;!
function a($b,$c)
    dim $,$d,$e
    $a=0
    for each $ in $b
        if left($,1)=$c[0]
            dim $f
            for each $d in $b
                dim $g
                for $e=2 to 0|$
                    if instr($d,right($,$e))=1
                        $g=$e
                    endif
                next
                if $g
                    if $d<>$
                        $f=$f+$g+1
                        $=$+' '+$d
                    endif
                    $g=($|)-$f
                    if right($,1)=$c[1]&$g<$a|1>$a
                        $a=''+$g+' '+$
endfunction
;!
;!
; end A-to-Z


Scores:


Running Test 1...Done...Result: 11 about outside ideas
Running Test 2...Done...Result: 4 ones
Running Test 3...Done...Result: 0
Running Test 4...Done...Result: 7 aabbbb bbbbz
Running Test 5...Done...Result: 0
Running Test 6...Done...Result: 9 ayrton onset
Running Test 7...Done...Result: 6 kita tart
Running Test 8...Done...Result: 11 about outside ideas
Your solution passed all tests

Your solution passed all tests

KiXtart
KiXtart Version  = 4.53
KiXGolf Script   = kixgolf_A2Z.kix

Computer
OS               = Windows 2000 Professional
CPU              =               Intel(R) Pentium(R) 4 CPU 2.80GHz
Speed            = 2793 MHz
Memory           = 504 MB

KiXGolf Scoring Engine
Scoring Engine   = 3.3

KiXtart Golf Score
Tournament       = A-to-Z
Processing Start = 2007/09/13 09:11:18.765
Processing End   = 2007/09/13 09:11:18.781
Duration         = 0000/00/00 00:00:00.016
KiXGolf Score    = 233

Thank you for participating in KiXtart Golf!


_________________________



Top
#180508 - 2007-09-13 11:04 AM Re: KiXgolf: A-to-Z - Public Round [Re: Jochen]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
 Originally Posted By: Jochen
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
#180509 - 2007-09-13 11:12 AM Re: KiXgolf: A-to-Z - Public Round [Re: DrillSergeant]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
No it doesn't ... it returns "13 against students"

(Note the changed dictionary sequence, 'outside' is now after 'ideas')
_________________________



Top
#180510 - 2007-09-13 11:24 AM Re: KiXgolf: A-to-Z - Public Round [Re: Jochen]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Ah, I see. Yep, you're right.

Hmmm, I'm really starting to harbor a resentment against our academic fellows too ;\)
_________________________
The Code is out there

Top
#180512 - 2007-09-13 11:29 AM Re: KiXgolf: A-to-Z - Public Round [Re: DrillSergeant]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
lol
_________________________



Top
#180513 - 2007-09-13 11:33 AM Re: KiXgolf: A-to-Z - Public Round [Re: DrillSergeant]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
benny's 215:

 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)+' '+$
					Else
						If Right($,$e)=Left($d,$e)
							$=$+' '+$d
							$f=$f+$e+1
EndFunction
;!
;!
; end A-to-Z




Your solution passed all tests

KiXtart
KiXtart Version = 4.52
KiXGolf Script = kixgolf_a2z.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium Model 13
Speed = 798 MHz
Memory = 1024 MB

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = A-to-Z
Processing Start = 2007/09/13 11:33:00.765
Processing End = 2007/09/13 11:33:00.796
Duration = 0000/00/00 00:00:00.031
KiXGolf Score = 215

Thank you for participating in KiXtart Golf!


Changed:
$a = ($^)-$f
$a=''+$a+' '+$

To

$a=''+(($^)-$f)+' '+$


Edited by DrillSergeant (2007-09-13 11:35 AM)
Edit Reason: explained change
_________________________
The Code is out there

Top
#180515 - 2007-09-13 11:39 AM Re: KiXgolf: A-to-Z - Public Round [Re: DrillSergeant]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Arrgh... had the very same line in one of my earlier approaches and didn't see it in Dales
_________________________



Top
#180516 - 2007-09-13 11:48 AM Re: KiXgolf: A-to-Z - Public Round [Re: Jochen]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Anyway, it could as well be a 214:




Function a($b,$c)
Dim $,$d,$e
$a=0
For Each $ in $b
Dim $f
For Each $d in $b
If $<$d
For $e = $^0 to 2 Step -1
If $=$c[0]+Left(Right($,~),~)+$c[1] & ($^)-$f<$a | ~$a
$a=''+(($^)-$f)+' '+$
Else
If Right($,$e)=Left($d,$e)
$=$+' '+$d
$f=$f+$e+1
; EndIf
; EndIf
; Next
; EndIf
; Next
; Next
EndFunction





Score:




Running Test 1...Done...Result: 11 about outside ideas
Running Test 2...Done...Result: 4 ones
Running Test 3...Done...Result: 0
Running Test 4...Done...Result: 7 aabbbb bbbbz
Running Test 5...Done...Result: 0
Running Test 6...Done...Result: 9 ayrton onset
Running Test 7...Done...Result: 6 kita tart
Running Test 8...Done...Result: 11 about outside ideas
Your solution passed all tests

Your solution passed all tests

KiXtart
KiXtart Version = 4.53
KiXGolf Script = kixgolf_A2Z.kix

Computer
OS = Windows 2000 Professional
CPU = Intel(R) Pentium(R) 4 CPU 2.80GHz
Speed = 2793 MHz
Memory = 504 MB

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = A-to-Z
Processing Start = 2007/09/13 11:45:08.734
Processing End = 2007/09/13 11:45:08.781
Duration = 0000/00/00 00:00:00.047
KiXGolf Score = 214

Thank you for participating in KiXtart Golf!


;\)


changed For $e = $d^0... to For $e = $^0


Edited by Jochen (2007-09-13 11:50 AM)
Edit Reason: exchanced plane :o
_________________________



Top
#180517 - 2007-09-13 11:51 AM Re: KiXgolf: A-to-Z - Public Round [Re: Jochen]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
sharp! \:\)
_________________________
The Code is out there

Top
#180518 - 2007-09-13 12:00 PM Re: KiXgolf: A-to-Z - Public Round [Re: DrillSergeant]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
<< incorrect post >>

Edited by DrillSergeant (2007-09-13 01:26 PM)
Edit Reason: incorrect result
_________________________
The Code is out there

Top
#180519 - 2007-09-13 12:02 PM Re: KiXgolf: A-to-Z - Public Round [Re: DrillSergeant]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
not so Sweet! ;\)

Edited by Jochen (2007-09-13 01:34 PM)
Edit Reason: changed reply ;)
_________________________



Top
#180522 - 2007-09-13 12:59 PM Re: KiXgolf: A-to-Z - Public Round [Re: Jochen]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Wait,

your 209 code fails the last test here (again the students)
_________________________



Top
#180523 - 2007-09-13 01:07 PM Re: KiXgolf: A-to-Z - Public Round [Re: Jochen]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
you sure? I've tested with this ini:
 Code:
[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
Page 1 of 4 1234>


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 466 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.106 seconds in which 0.053 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org