Welcome Guest
Log In | Register )
You last visited January 21, 2017, 5:35 am
All times shown are
Eastern Time (GMT-5:00)

Ordering possible numbers?

Topic closed. 16 replies. Last post 5 years ago by KnuckleHead.

Page 2 of 2
PrintE-mailLink
time*treat's avatar - radar

United States
Member #13130
March 30, 2005
2171 Posts
Offline
Posted: January 18, 2012, 10:29 pm - IP Logged

What is happening here is that each number is given a status of active or inactive, based on if it is in Group A.

A count-up is given from 000 to 999 (although 789 would work just as well)

The "count" value is broken down into its 3 component digits.

These digits are checked to see if they are
a) low to high
b) unequal from each other and
c) all among the "active" numbers

Checking each combo is not the most efficient way to do things, but is the simplest to code and understand. That's what you need in the beginning. Slow running, but readable. Using F5, F8, and the break function helps, too.

 

When you get to Pick 5 games, where you're potentially looking at 300,000 ~ 1,000,000 combinations, then you drop simplicity and aim for efficiency of processing time. Then you would write it exactly as you described it above -- taking the given numbers and creating the list from them. Of course, when you get to that level, you're no longer asking "How do I ... ?", you're writing this stuff in your sleep and just looking for new ideas.  If you've looked as some of the old lexi code posted here, you've no doubt noticed that much of it isn't very clearly explained and it looks a lot like spaghetti. Wink

That's what fast running code looks like. Eek

In neo-conned Amerika, bank robs you.
Alcohol, Tobacco, and Firearms should be the name of a convenience store, not a govnoment agency.

    KnuckleHead's avatar - box

    United States
    Member #73037
    April 3, 2009
    147 Posts
    Offline
    Posted: January 18, 2012, 11:20 pm - IP Logged

    time*treat,

    Thank you for the explanation.

    As for "writing this stuff in your sleep", I'm already doing that. Sometimes their terrible nightmares though... Not having very much experience at writing code, I come up with different ideas to do the things in code that I'd normally do with keystrokes. It's a learning thing. If I can automate my keystrokes to simply "clicking" a button and having the sub do the work, then I've learned something new and am able to use some of it for the next project.

    And, by asking questions here, if someone else doesn't have the knowledge, and if they read the posts, maybe they can learn something also. This is why I tend to ask what I'm sure sounds like dumb questions to experenced users. The more detail, the more an inexperienced person is able to follow along.

    I can't thank you enough for the assistance.

              The only DUMB question is the one question you DID NOT ask...