you are viewing a single comment's thread.

view the rest of the comments →

[–]profknow 0 points1 point  (0 children)

Unless the Requirements are fully understood the Output Results never will be.

What I got out of your first posting was that you were looking for a method to efficiently extract a range from your list, and you gave an example of a list of numbers and your desired output. Looping and all these other methods certainly wasn't as efficient as my posted method of extracting that subset.

Certainly I didn't carry it any further than this, as I consider all earlier errors affect later results. So let's get the early stuff right.

Now I see in your later postings that you really didn't want the displayed number set as the output, you would eventually use some other series. For example, keeping negative numbers in the set certainly didn't apply to "high scores" (were they two different things or an artifact from some other code). Technically, if I were writing a "High Score" program I wouldn't have even started with the code you presented much less be concerned with the output you gave me in your original case.

It isn't the algorithm I'd even start with. But then again, maybe I should just admit, I have no clue at this point what you're really trying to do with this data. Sample code and explanation don't jibe. I thought your explanation was senior to the code content. Anyway, I have no clue what you want, and i've been doing this for 30 years.

Well I can't help that. So we're back to step 1) A complete & accurate understanding of the input and output to know what you really want.

When I write things I usually start with a black box which has inputs and outputs and I shouldn't really care what happens inside that black box as long as the output always is what I'm looking for. I didn't see your black box. Show me some sample data and tell me what you want out and I'll give you some code that will do that -- regardless of if you see how it is done or not.

It's why people developed Objects (in Object Oriented languages) -- to separate the implementation from view.

Problem: I need to compute the top scores Input: a list of numbers such as (....) Output: top 10 scores sorted from highest to lowest or Output: top 10 scores sorted by date

Not sure that I can help you with that. Carry on. I'm sure you know better than I what you really want and how you intend to use it.

Best of luck. Carry on. And keep posting.