Page 1 of 8 12345>Last »
Topic Options
#171942 - 2006-12-22 11:09 PM KiXgolf: Human Sort
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
=============
The Challenge
=============


Sort a set of lines, but with a twist.

When sorting a set of lines, humans like to see the numeric parts of a line sorted numerically and the alphabetical parts case insensitive. For the numeric parts you may ignore the possibility of negative numbers, floating point numbers and leading zeros, the numbers however are almost unconstrained in length. In other words, a sequence of one or more digits plays the same sort of role as some kind of single character, and such a sequence sorts before all normal letters, but among themselves they are ordered by numerical value. Example:

1 < A < amstelveen < Amsterdam < Amsterdam5 < Amsterdam40 < Amsterdamned

So, an ordered array of the strings above would look like:
1
A
amstelveen
Amsterdam
Amsterdam5
Amsterdam40
Amsterdamned

You are free in how you order e.g. fOo versus FoO or a digit versus space.

A download is available at http://s91376351.onlinehome.us/kixtart/kixgolf_humansort.zip


=============
Specification
=============


You are to write a KiXtart program that performs a "human sort" as specified above. Test cases are being provided to test the validity of the algorithm.


=============
Inputs & Outputs
=============


The input will be a one-dimensional array containing a set of strings.
The output will be a one-dimensional array containing the set of strings provided by the input but sorted according to the "human sort" algorithm.


=======
Scoring
=======


All provided test cases must be correctly solved in order to have the KiXgolf score count. However, if a script fails any valid public or non-public test case the KiXgolf score will not count.



========
Deadlines
========


Private coding starts Friday, December 22, at 5pm EST
Private coding ends Saturday, December 30, at 6pm EST
Public coding start Saturday, December 30, at 6pm EST
Public coding ends Sunday, January 7 at 6pm EST


============
Test program
============


Test cases are provided to help screen entries and to provide the Golf Score.
Any script that passes the test cases can be submitted. If you are surprised that your solution passed the test cases, please submit it anyway! That will help me identify bugs in the test program.

================================================================
KiXtart GOLF - How To Play
================================================================


Most importantly, anybody can play, no age restrictions, no penalties, no handicap!

The object in "real" golf is to hit the ball in the hole in the fewest strokes. The object in KiXtart Golf is to get from input (tee) to target (hole) in the fewest keystrokes.

Example: How many positive elements are in array $a?

Array $a could be of structure $a=[1, 2 ,-3, 4, -5, -7, 8, 9]

One approach:
Code:
for $b=0 to ubound($a)
  if $a[$b]>0
    $c=$c+1
  endif
next

for a score of 45.

Another solution is:
Code:
DO
  $b=$b+1
  if $a[$b]>0
    $c=$c+1
  endif
UNTIL $b>(UBOUND($a)+1)

for a score of 53.

Better approach: Code sample 1

================================================================
KiXtart GOLF - The Rules
================================================================


1) The goal of KiXtart Golf is to score the lowest strokes.
2) Strokes are all characters in a piece of code except whitespace characters, unless the whitespace character is necessary for the line of code to work. Therefore, carriage returns and line feeds do not count or spaces in between the '=' sign when assigning variables, e.g. '$a = $b' scores 5.
3) Code can be constructed any way you like, as long as it does not generate syntax or other errors when running the script in KiXtart.
4) The final solution MUST pass all test scripts that accompagny the KiXtart golf challenge. Some test scripts may not be included in the publicly available test suite but may be utilized as part of the official KiXgolf score verification.
7) During the private coding phase, no code is allowed to be posted. Violations result in disqualification of said player.
8) During the public coding phase, code should be posted, reused, and borrowed from other players.
9) The test script contains the official KiXgolf scoring engine
10) Only the person posting a particular score will be recognized for the score, unless the KiXtart Golf Challenge organizer or another delegate posts code on behalf of a player
11) KiXtart Golf (a.k.a KiXgolf) codes must be written inside the KiXgolf UDF collection tags, ';!' and ';!;!'
12) Parameter names of the UDF's can be changed and additional optional parameters can be added.
13) Additional helper UDFs can be written as long as they reside inside the ';!' and ';!;!' tags.
14) The use of '$' as a variable is allowed.
15) The UDF layout is up to coder.
16) The UDF is expected to finish in a reasonable time, that is, on modern computers inside 1 hour timeframe.
17) You can submit scores as often as you want.
18) If you reach leading score, you are obligated to post your score immediately so others can try to compete with you.
19) The UDF may only use the KiXtart/KiXforms commands/functions/macros, no other code fragments are allowed.
20) Calls to COM components that are part of a standard default Windows installation are allowed.
21) The use of the KiXforms DLL is also permitted as the KiXforms DLL can now be considered an integral part of KiXtart scripting.
22) Calls to other executables, as long as they are part of a standard default Windows installation are allowed.
23) The UDF should be self-contained (except for any I/O mentioned in the challenge). In particular, you may not do things like fetching extra data from a remote site or file.
24) You may assume ASCII as character set.
25) You may use block comments as the KiXgolf Scoring Engine now supports block comments.
26) You are allowed to only use publicly available versions of KiXtart and KiXforms, private builds or alpha builds are NOT allowed.
27) Your submitted score must include the result print of the KiXgolf test-engine.
28) The SETOPTION() parameters in the KiXgolf script may not be modified and will govern the script behavior. SETOPTION() parameters may change depending on the particular needs of the KiXgolf challenge.
29) Tokenizing the UDF, script, or portions thereof is not allowed.
30) If something is not explicitly denied by the rules, it's allowed.
31) If Confusion arises, arranger of the KiXgolf round has the final say.


You will need the complete package from http://s91376351.onlinehome.us/kixtart/kixgolf_humansort.zip.
_________________________
There are two types of vessels, submarines and targets.

Top
#171943 - 2006-12-22 11:11 PM Re: KiXgolf: Human Sort [Re: Sealeopard]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Please note that I might not be able to switch from the private to the public round at the specified time. Therefore, the participants are explicitly allowed to initiate the public round at the specified time, Decemebr 30 at 6pm EST.

Happy Holidays.
_________________________
There are two types of vessels, submarines and targets.

Top
#171944 - 2006-12-22 11:38 PM Re: KiXgolf: Human Sort [Re: Sealeopard]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, think I got it.
will not be able to code in hours, but the principal is quite clear... and simple.
_________________________
!

download KiXnet

Top
#171945 - 2006-12-22 11:45 PM Re: KiXgolf: Human Sort [Re: Lonkero]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Consider it my Christmas present \:\)
_________________________
There are two types of vessels, submarines and targets.

Top
#171948 - 2006-12-23 12:12 AM Re: KiXgolf: Human Sort [Re: Sealeopard]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Seems simple so I'm going to feel real bad if I can't get this one going on my own
Top
#171961 - 2006-12-23 06:01 AM Re: KiXgolf: Human Sort [Re: NTDOC]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4548
Loc: USA
Doc... you playing? As you said, seems simple... but it not. Grrr!
Top
#171962 - 2006-12-23 06:11 AM Re: KiXgolf: Human Sort [Re: Allen]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
oh! don't say that ALLEN I hope to but have not tried yet. About to play some Need For Speed
Top
#171963 - 2006-12-23 04:38 PM Re: KiXgolf: Human Sort [Re: NTDOC]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
Code:
KiXtart Version  = 4.53
KiXGolf Script   = kixgolf_humansort.kix

 OS               = Windows Vista Enterprise Edition
 CPU              = Intel Pentium Model 13
 Speed            = 1866 MHz
 Memory           = 758 MB
KiXGolf Scoring Engine
 Scoring Engine   = 3.3
KiXtart Golf Score
 Tournament       = KiXtart Golf: Human Sort
 Processing Start = 2006/12/23 17:38:34.921
 Processing End   = 2006/12/23 17:38:35.051
 Duration         = 0000/00/00 00:00:00.129
 # Tests Run      = 7
 # Tests Passed   = 7
 # Tests Failed   = 0
 Result           = passed
 KiXGolf Score    = 489

Thank you for participating in KiXgolf!


{edit} removed some unused lines to remove the scrolling from the post.


Edited by Jooel (2006-12-23 04:41 PM)
_________________________
!

download KiXnet

Top
#171964 - 2006-12-23 06:29 PM Re: KiXgolf: Human Sort [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
so, anyone else coding yet?
Code:
KiXtart Version  = 4.53
KiXGolf Script   = kixgolf_humansort.kix

Computer
OS               = Windows Vista Enterprise Edition
CPU              = Intel Pentium Model 13
Speed            = 1866 MHz
Memory           = 758 MB

KiXGolf Scoring Engine
Scoring Engine   = 3.3

KiXtart Golf Score
Tournament       = KiXtart Golf: Human Sort
Processing Start = 2006/12/23 19:29:23.418
Processing End   = 2006/12/23 19:29:23.577
Duration         = 0000/00/00 00:00:00.158
# Tests Run      = 7
# Tests Passed   = 7
# Tests Failed   = 0
Result           = passed
KiXGolf Score    = 479
_________________________
!

download KiXnet

Top
#171965 - 2006-12-23 06:32 PM Re: KiXgolf: Human Sort [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK

KiXtart Version = 4.53
KiXGolf Script = kixgolf_humansort.kix

Computer
OS = Windows Vista Enterprise Edition
CPU = Intel Pentium Model 13
Speed = 1866 MHz
Memory = 758 MB

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = KiXtart Golf: Human Sort
Processing Start = 2006/12/23 19:32:31.247
Processing End = 2006/12/23 19:32:31.438
Duration = 0000/00/00 00:00:00.190
# Tests Run = 7
# Tests Passed = 7
# Tests Failed = 0
Result = passed
KiXGolf Score = 462
_________________________
!

download KiXnet

Top
#171967 - 2006-12-23 08:33 PM Re: KiXgolf: Human Sort [Re: Lonkero]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
LOL dude you suck - thinking of this. This is creating a combsort type UDF from scratch.
Top
#171968 - 2006-12-23 08:36 PM Re: KiXgolf: Human Sort [Re: NTDOC]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ja.
basically simple sort udf would do, but kixtart sorts "abc9" higher than "abc89"
that's the only reason I had to grow my udf from about 100 strokes to lot more.
_________________________
!

download KiXnet

Top
#171969 - 2006-12-23 08:46 PM Re: KiXgolf: Human Sort [Re: Lonkero]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
I knew it sounded too simple. Will still look into it, but doing a combsort from scratch is not my forte.
Top
#171971 - 2006-12-23 09:40 PM Re: KiXgolf: Human Sort [Re: NTDOC]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
not same deal.
_________________________
!

download KiXnet

Top
#171972 - 2006-12-23 09:50 PM Re: KiXgolf: Human Sort [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
Code:
KiXtart Version  = 4.53
 Scoring Engine   = 3.3
 KiXGolf Script   = kixgolf_humansort.kix

Computer
 OS               = Windows Vista Enterprise Edition
 CPU              = Intel Pentium Model 13
 Speed            = 1866 MHz
 Memory           = 758 MB

KiXtart Golf Score
 Tournament       = KiXtart Golf: Human Sort
 Processing Start = 2006/12/23 22:49:45.596
 Processing End   = 2006/12/23 22:49:45.749
 Duration         = 0000/00/00 00:00:00.152
 # Tests Run      = 7
 # Tests Passed   = 7
 # Tests Failed   = 0
 Result           = passed
 KiXGolf Score    = 457
_________________________
!

download KiXnet

Top
#171973 - 2006-12-24 12:05 AM Re: KiXgolf: Human Sort [Re: Lonkero]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
Jooel you are not alone, I am trying to come up with a working script. I have a partial working script but the numbers thing is kicking my a$$.
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#171974 - 2006-12-24 02:35 AM Re: KiXgolf: Human Sort [Re: Benny69]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, I believe you benny.

so, one more before I get to bed...


KiXtart Version = 4.53
KiXGolf Script = kixgolf_humansort.kix

Computer
OS = Windows Vista Enterprise Edition
CPU = Intel Pentium Model 13
Speed = 1866 MHz
Memory = 758 MB

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = KiXtart Golf: Human Sort
Processing Start = 2006/12/24 03:34:58.582
Processing End = 2006/12/24 03:34:58.803
Duration = 0000/00/00 00:00:00.220
# Tests Run = 7
# Tests Passed = 7
# Tests Failed = 0
Result = passed
KiXGolf Score = 372
_________________________
!

download KiXnet

Top
#171975 - 2006-12-24 02:45 AM Re: KiXgolf: Human Sort [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well. one more:

KiXGolf Score = 364
_________________________
!

download KiXnet

Top
#171976 - 2006-12-24 02:46 AM Re: KiXgolf: Human Sort [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
just realised, doc said I suck.
little odd words from his keyboard...
_________________________
!

download KiXnet

Top
#171978 - 2006-12-24 02:59 AM Re: KiXgolf: Human Sort [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK

KiXtart Version = 4.53
KiXGolf Script = kixgolf_humansort.kix

Computer
OS = Windows Vista Enterprise Edition
CPU = Intel Pentium Model 13
Speed = 1866 MHz
Memory = 758 MB

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = KiXtart Golf: Human Sort
Processing Start = 2006/12/24 03:58:23.446
Processing End = 2006/12/24 03:58:23.585
Duration = 0000/00/00 00:00:00.138
# Tests Run = 7
# Tests Passed = 7
# Tests Failed = 0
Result = passed
KiXGolf Score = 358
_________________________
!

download KiXnet

Top
Page 1 of 8 12345>Last »


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

Who's Online
1 registered (Allen) and 286 anonymous users online.
Newest Members
Timothy, Jojo67, MaikSimon, kvn317, kixtarts2025
17874 Registered Users

Generated in 0.074 seconds in which 0.025 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