#172255 - 2006-12-31 12:42 AM
KiXgolf: Human Sort - Public Round
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
Since Jens has not already done so, it is now after 6:00pm EST and he has given permission to do so, I hereby Close the Private Round and Open the Public Round. Participants, please post your Private Round code.
|
Top
|
|
|
|
#172256 - 2006-12-31 12:42 AM
Re: KiXgolf: Human Sort - Public Round
[Re: Benny69]
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
With out further adu, here is my surprisingly not so amazing 208 code:
Function a($)
Dim $c,$d,$e
For $c = 0 to UBound($)
For $d = $c + 1 to UBound($)
If b($[$d]) < b($[$c])
$e = $[$d]
$[$d] = $[$c]
$[$c] = $e
; EndIf
; Next
; Next
$a=$
EndFunction
Function b($)
Dim $f,$g
For $g = Len($) to 99
For $f = 0 to 9
$=Join(Split($,$f),#+$f)
; Next
; Next
$b=$
EndFunction
|
Top
|
|
|
|
#172271 - 2007-01-01 01:11 PM
Re: KiXgolf: Human Sort - Public Round
[Re: Sealeopard]
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
ok had to revert back to an earlier code, this one has no hard-coded length.
240
Function a($)
Dim $c,$d,$e,$f
$f=Len(Join($))
For $c = 0 to UBound($)
For $d = $c + 1 to UBound($)
If b($[$d],$f) < b($[$c],$f)
$e = $[$d]
$[$d] = $[$c]
$[$c] = $e
EndIf
; Next
; Next
$a=$
EndFunction
Function b($,$i)
Dim $g,$h
For $h = Len($) to $i
For $g = 0 to 9
$=Join(Split($,$g),#+$g)
; Next
; Next
$b=$
EndFunction
KiXtart Version = 4.53 KiXGolf Script = kixgolf_humansort.kix
Computer OS = Windows XP Professional CPU = Intel(R) Pentium(R) D CPU 2.80GHz Speed = 2793 MHz Memory = 2048 MB
KiXGolf Scoring Engine Scoring Engine = 3.3
KiXtart Golf Score Tournament = KiXtart Golf: Human Sort Processing Start = 2007/01/01 05:55:17.703 Processing End = 2007/01/01 06:00:26.781 Duration = 0000/00/00 00:05:09.077 # Tests Run = 9 # Tests Passed = 9 # Tests Failed = 0 Result = passed KiXGolf Score = 240
Thank you for participating in KiXgolf! Press any key to continue...
|
Top
|
|
|
|
#172274 - 2007-01-01 03:06 PM
Re: KiXgolf: Human Sort - Public Round
[Re: Benny69]
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
k, got back home. here are my 2 codes. first the shorter, 264:
Function a($)
dim $e,$k,$b,$l,$x
$a=$
$l = len(join($))
for $e=1 to ubound($)
$x=$a[$e-1]
for $k=1 to $l
$ = substr($x,$k)
$b = substr($a[$e],$k)
if 0+$+$b and $ and $b
$=1.1*(0=$)*$b+$
$b=1.1*$*(0=$b)+$b
else
$ = left($,1)
$b = left($b,1)
endif
if $<>$b
$k = $l
if $>$b
$a[$e-1] = $a[$e]
$a[$e] = $x
$e = 0
EndFunction
and then the longer that handles any sort of string, no matter what the length.
Function a($)
dim $e,$k,$b,$l,$z
$a=$
for $e=1 to ubound($)
$l = len(join($a))
for $k=1 to $l
$z=$a[$e-1]
$b=c($a[$e],$k)
$=c($z,$k)
if $<>$b
$k = $l
$l = len($) - len($b)
if ($ and 0.<$b & 0<$l | 0=$) | !>$b | $>$b & $l=0
$a[$e-1] = $a[$e]
$a[$e] = $z
$e = 0
EndFunction
function c($z,$k)
dim $
do
$c=substr($z,$k+$,1)
$=$+1
until !>$c | $c>9
$c=substr($z,$k,$-($>1))
endfunction
I don't know why, but I tried benny's way and never got that thingie working. will need to look for it closer...
_________________________
!download KiXnet
|
Top
|
|
|
|
#172286 - 2007-01-01 05:52 PM
Re: KiXgolf: Human Sort - Public Round
[Re: Lonkero]
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
It figures I missed some obvious ones.
|
Top
|
|
|
|
#172290 - 2007-01-01 07:28 PM
Re: KiXgolf: Human Sort - Public Round
[Re: Lonkero]
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
This is another approch that I was working with.
KiXtart Version = 4.53 KiXGolf Script = kixgolf_humansort.kix
Computer OS = Windows XP Professional CPU = Intel(R) Pentium(R) D CPU 2.80GHz Speed = 2793 MHz Memory = 2048 MB
KiXGolf Scoring Engine Scoring Engine = 3.3
KiXtart Golf Score Tournament = KiXtart Golf: Human Sort Processing Start = 2007/01/01 12:25:18.750 Processing End = 2007/01/01 12:25:51.109 Duration = 0000/00/00 00:00:32.358 # Tests Run = 9 # Tests Passed = 9 # Tests Failed = 0 Result = passed KiXGolf Score = 236
Thank you for participating in KiXgolf! Press any key to continue...
Function a($)
Dim $c
For $c = 1 to UBound($)
$a = $[$c-1]
If b($a,$) > b($[$c],$)
$[$c-1] = $[$c]
$[$c] = $a
$c = 0
EndIf
$a=$
EndFunction
Function b($,$e)
Dim $c,$d
While $
$d=Left($,1)
If Int($d) > 0
For $c = Len($) to Len(Join($e))
$d=#+$d
Next
EndIf
$=Right($,~)
$b=$b+$d
EndFunction
|
Top
|
|
|
|
#172292 - 2007-01-01 08:09 PM
Re: KiXgolf: Human Sort - Public Round
[Re: Lonkero]
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
|
Top
|
|
|
|
#172387 - 2007-01-04 03:17 PM
Re: KiXgolf: Human Sort - Public Round
[Re: Benny69]
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
Is no one else going to post any code?
|
Top
|
|
|
|
#172559 - 2007-01-09 07:34 AM
Re: KiXgolf: Human Sort - Public Round
[Re: Sealeopard]
|
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4545
Loc: USA
|
While I didn't post any working code, I spent quite a bit of time on this "easy" one, only to get frustrated at every turn. I only hope the next one is so "easy"
Didn't Eric have some working code... I wonder why he never posted it.
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 248 anonymous users online.
|
|
|