04-27-2009 03:01 PM
04-27-2009 03:15 PM - edited 04-27-2009 03:17 PM
leaf34,
As Matt previously suggested, you need to convert your 2D array of strings into a 1D array of clusters. Convert the players time to an integer for element 1 of the cluster and use the 'player' string as element 2. Sort the array of clusters and then build your bracket. Here's one way to do it. Note that this assumes an even # of players.
04-27-2009 03:48 PM
Each snowflake in an avalanche pleads not guilty. - Stanislaw J. Lec
I haven't failed, I've found 10,000 ways that don't work - Ben Franklin (-Tomas Alva Edison) the IRONY!!!!
Beware of the man who won't be bothered with details. - William Feather
The greatest of faults is to be conscious of none. - Thomas Carlyle
04-27-2009 05:20 PM - edited 04-27-2009 05:21 PM
Here's a quick draft on how you could replace all that mathscript monstrosity. Modify as needed. (there are probaby some bugs).
04-27-2009 05:27 PM
Note that your text file is "dirty", with e.g. variable amounts of spaces seperating fields. This makes reading it as a 2D array of string impossible.
In my solution, I read it as 1D array with one line per array element and parse the two fields (name, score) directly. Now I create a sort key according to the score and then index out the corresponding names for the output.
04-27-2009 09:24 PM
I haven't failed, I've found 10,000 ways that don't work - Ben Franklin (-Tomas Alva Edison) the IRONY!!!!
Ooh... thanks for the correction. It's amazing how many sources credit this quote to Franklin. Still good though. Nice to know people are reading my signature too.
06-01-2009 08:55 AM
Troy K wrote:I haven't failed, I've found 10,000 ways that don't work - Ben Franklin (-Tomas Alva Edison) the IRONY!!!!
Ooh... thanks for the correction. It's amazing how many sources credit this quote to Franklin. Still good though. Nice to know people are reading my signature too.
Yes- Its one of the most often mis-atributed quotes. One old Russian proverb translates to " Trust always, but verify"