Welcome Guest
Log In | Register )
You last visited December 8, 2016, 12:55 am
All times shown are
Eastern Time (GMT-5:00)

Digit/Pairs Reduction

43 replies. Last post 23 days ago by garyo1954.

Page 2 of 3
52
PrintE-mailLink
garyo1954's avatar - garyo
Dallas, Texas
United States
Member #4549
May 2, 2004
1701 Posts
Offline
Posted: November 10, 2016, 1:05 pm - IP Logged

Thanks gary!  I downloaded it last night!

So for example the last 3 draws

123

456

789

We put in pairs

12

23

45

56

78 89

?

Yes sir, that's the way I understood it.

When I tried that idea, I lost twice......LOL

Might be better to eliminate pairs that have hit two or more times in the last month?

My greatest accomplishment is teaching cats about Vienna Sausage. When I need a friend, all I need do is walk outside, pop open a can, and every little critter in the neighborhood drops by to say "Hi!"

    lakerben's avatar - spherewall
    New Mexico
    United States
    Member #86099
    January 29, 2010
    11119 Posts
    Offline
    Posted: November 10, 2016, 1:10 pm - IP Logged

    I'll play around with it! Thanks!

    How about them cowboys!

     

     

    US Flag

      Avatar

      United States
      Member #41846
      June 23, 2006
      459 Posts
      Offline
      Posted: November 10, 2016, 1:16 pm - IP Logged

      Sorry about that Bob.

      Had a few eagle eyes bring the pairs function to my attention. 

      When removing a pair with a leading zero the program drops the second digit. When they tried removing say 05, the program removed zero.

      You would think I checked that. I didn't. Some did.

      Has to be in the editing. I'll get it figured out and put up another link.

      Program still works. You can remove pairs 01 thru 09 by entering the single digit.....for 01 enter 1, 02 enter 2......so forth.

      I'll write a readme with the new version. That way people will have a better understanding of the purpose and how to use it.

      Guess yesterday wasn't my day.....and today's chances are looking slim.

      You might check to see if the program you are using implements the Len statement. If it does you can check for 0,1 or 2 digits entered and proceed accordingly.

        garyo1954's avatar - garyo
        Dallas, Texas
        United States
        Member #4549
        May 2, 2004
        1701 Posts
        Offline
        Posted: November 10, 2016, 5:25 pm - IP Logged

        You might check to see if the program you are using implements the Len statement. If it does you can check for 0,1 or 2 digits entered and proceed accordingly.

        Thank you, phil! Likely you nailed it! Makes a lot sense too.

        First program I used strings with a data file.

        In the new one, I did away with the data file, making numeric combos inside the program. (Sounded like a good idea at the time)

        Here's what I'm thinking..... (weirdo guy post ahead!)

        Making pairs from the calculated three digit combos, the numeric values are in string form N1$ = STR$(N1).

        Then Pr1$=(N1$ + N2$) (first pair is equal to the first string plus the second string).

        Next we need the numeric value of Pr1$ to compare the input to the computed pairs,  so Pr1=VAL(Pr1$).

        The end game is if N1$ = "0" and N2$ = "6" (any real number) then Pr1$ = ("0+6").

        And when we change that into Pr1=VAL(0+6) we get 6.

        Technically the program is correct the string 06 is not the same as the numeric value 6.

        Humanwise the program is wrong.

        Failure on my part not thinking like a computer.

        (Anyone who doesn't understand, just nod. Consider this post just a weirdo guy making a weirdo post. Have pity.)

        My greatest accomplishment is teaching cats about Vienna Sausage. When I need a friend, all I need do is walk outside, pop open a can, and every little critter in the neighborhood drops by to say "Hi!"

          Avatar

          United States
          Member #41846
          June 23, 2006
          459 Posts
          Offline
          Posted: November 10, 2016, 6:18 pm - IP Logged

          Thank you, phil! Likely you nailed it! Makes a lot sense too.

          First program I used strings with a data file.

          In the new one, I did away with the data file, making numeric combos inside the program. (Sounded like a good idea at the time)

          Here's what I'm thinking..... (weirdo guy post ahead!)

          Making pairs from the calculated three digit combos, the numeric values are in string form N1$ = STR$(N1).

          Then Pr1$=(N1$ + N2$) (first pair is equal to the first string plus the second string).

          Next we need the numeric value of Pr1$ to compare the input to the computed pairs,  so Pr1=VAL(Pr1$).

          The end game is if N1$ = "0" and N2$ = "6" (any real number) then Pr1$ = ("0+6").

          And when we change that into Pr1=VAL(0+6) we get 6.

          Technically the program is correct the string 06 is not the same as the numeric value 6.

          Humanwise the program is wrong.

          Failure on my part not thinking like a computer.

          (Anyone who doesn't understand, just nod. Consider this post just a weirdo guy making a weirdo post. Have pity.)

          I know every programmer has their own way to approach problems. for some it's " this is the way I learned to do it", for others they think there is a speed or other advantage, sometimes it's limitations of the program being used.

           this leads me to ask why do you take a value and convert it to a string to then convert the string back to a value?

            having each value in its own (non string) variable should solve the 0 problem 

          what program are you using?

            garyo1954's avatar - garyo
            Dallas, Texas
            United States
            Member #4549
            May 2, 2004
            1701 Posts
            Offline
            Posted: November 10, 2016, 7:46 pm - IP Logged

            I know every programmer has their own way to approach problems. for some it's " this is the way I learned to do it", for others they think there is a speed or other advantage, sometimes it's limitations of the program being used.

             this leads me to ask why do you take a value and convert it to a string to then convert the string back to a value?

              having each value in its own (non string) variable should solve the 0 problem 

            what program are you using?

            Good question......

            If our digits generated by the computer are represented as N1, N2, N3, our pairs are N1N2...N2N3....and N1N3.

            But we can't use N1N2. The program will recognize that as 0.

            We can't use N1+N2. The Program will add the two digits. So 57 is not the same a 5+7.

            We can't use N1;N2. The program will read it as two separate digits. 57 is not the same as 5 7.

            The next best solution is using strings.

            Problem #1: You can't combine numeric values into a string. Str$=(N1+N2) is apples (strings) trying to be elephants (numeric values).

            We have to make the elephants into apples using the STR() function.....N1$=STR$(N1).

            Now we can put our apples together. Pr$=N1$ + N2$.

            Problem #2: You have pairs input by the user as numeric, call it value A (oranges), and pairs you made using the string function Pr$ (apples).

            Again we can't compare oranges to apples. Everybody needs to be oranges. So we use the VAL() function. Pr = VAL(Pr$).

            Now we can compare A (the input pair) against Pr (the pair made by the program).

            Maybe I'm overthinking it????

            If there is an easier way......I'm all ears and eyeballs!

            My greatest accomplishment is teaching cats about Vienna Sausage. When I need a friend, all I need do is walk outside, pop open a can, and every little critter in the neighborhood drops by to say "Hi!"

              Avatar

              United States
              Member #41846
              June 23, 2006
              459 Posts
              Offline
              Posted: November 10, 2016, 9:27 pm - IP Logged
              if I can assume that the combination is n1, n2, n3 and the actual number is for instance 0 3 5 not 035. since dealing with box combinations these should be sorted lo to hi
              now the possible pairs are n1 and n2 , n2 and n3 , n1 and n3
              the user input 0 7 as a pair to filter out and is stored in p1 and p2. since the user could input 07 you need some error handling to convert this to 0 7
              it may be simpler to expect 07 or 25 for example then break it down. if entry is in p5
              a=len(p5)
              if a=1 then p1=0:p2=p5  '  a value like 07 was entered and computer treats as single digit
              if a=2 then p1=val(left(p5,1)):p2=val(right(p5,1))' a two digit value was entered ex 45 or 27
              if n1=p1 and n2=p2 or n1=p2 and n2=p1 then accept else reject ' your code to handle accept and display or reject and ignore
              repeat for next pair
              repeat for next combination    I love for next loops
              since everything is values no back and forth. notice i included a val() statement in the above. it should not be needed.  I work mostly with excel and sometimes values become text whether you wanted it or not. so I almost always use val() even when it should not be needed.
                mmx1's avatar - 8ball

                Canada
                Member #90040
                April 20, 2010
                473 Posts
                Offline
                Posted: November 10, 2016, 9:49 pm - IP Logged

                Bang Head

                  garyo1954's avatar - garyo
                  Dallas, Texas
                  United States
                  Member #4549
                  May 2, 2004
                  1701 Posts
                  Offline
                  Posted: November 11, 2016, 12:12 am - IP Logged
                  if I can assume that the combination is n1, n2, n3 and the actual number is for instance 0 3 5 not 035. since dealing with box combinations these should be sorted lo to hi
                  now the possible pairs are n1 and n2 , n2 and n3 , n1 and n3
                  the user input 0 7 as a pair to filter out and is stored in p1 and p2. since the user could input 07 you need some error handling to convert this to 0 7
                  it may be simpler to expect 07 or 25 for example then break it down. if entry is in p5
                  a=len(p5)
                  if a=1 then p1=0:p2=p5  '  a value like 07 was entered and computer treats as single digit
                  if a=2 then p1=val(left(p5,1)):p2=val(right(p5,1))' a two digit value was entered ex 45 or 27
                  if n1=p1 and n2=p2 or n1=p2 and n2=p1 then accept else reject ' your code to handle accept and display or reject and ignore
                  repeat for next pair
                  repeat for next combination    I love for next loops
                  since everything is values no back and forth. notice i included a val() statement in the above. it should not be needed.  I work mostly with excel and sometimes values become text whether you wanted it or not. so I almost always use val() even when it should not be needed.

                  I'm EXTREMELY PLEASED! You DO UNDERSTAND!

                  I knew you worked with Excel and thought I'd use the concatenate function to explain, but couldn't find the right example. 

                  You pretty much nailed the first program!

                  I input from a data file as a three digit real number 000, 345, 789 as N1.

                  Stripped them down using Left$, Mid$, Right$ and made pairs.

                  Not sure QB64 supports Left without the $. Never tried it Oogle.  Have hundreds of programs written for 2 Step, Cash5, Lotto, MMs and Powerball using Left$, Right$ to split 2 digit numbers! Scared

                  If it works I learned something.

                  If it don't, I learned something different.

                  Either way, the easy solution is to split the pairs input by the user and compare those to the generated single digits. 

                  More work than what I wanted do to. So I'll cheat. I'll steal a snippet from a 2Step program. LOL

                  LESSON LEARNED! If something is working, DO NOT MESS WITH IMPROVING IT! 49% of the time you won't! 49% of the time you'll break it!

                  100% of the time it's a do over!

                  Thanks Phil! I'll let you know how it goes!

                   

                  Good night!

                   

                  Sal

                  My greatest accomplishment is teaching cats about Vienna Sausage. When I need a friend, all I need do is walk outside, pop open a can, and every little critter in the neighborhood drops by to say "Hi!"

                    garyo1954's avatar - garyo
                    Dallas, Texas
                    United States
                    Member #4549
                    May 2, 2004
                    1701 Posts
                    Offline
                    Posted: November 11, 2016, 2:22 am - IP Logged

                    Couldn't sleep.

                    Had to satisfy curiosity.

                    Tried......

                    Input, "Pair";RS

                    A=LEN(RS)

                    A=VAL(LEFT(RS,1))

                    Status bar screams:

                    String required for function on current line

                    Okay then.....

                    A=VAL(LEFT(RS$,1))

                    Status bar....

                    Illegal string-number conversion on current line

                    How about....

                    A$=VAL(LEFT$(RS$,1))

                    Illegal string-number conversion on current line!

                    uhhhh....

                    Input "Pair"; RS$

                    A$ = VAL(LEFT$(RS$,1)

                    Status bar......

                    What don't you understand? ILLEGAL STRING-NUMBER CONVERSION ON CURRENT LINE

                    Just kidding computer...hehehe.....I'll use

                    Input "Pair"; RS$

                    A = VAL(LEFT$(RS$,1)

                    Status bar

                    OK

                    That's our answer.

                    Sadly, this means I'm losing it. I likely tried without the $ before and it wouldn't work. So I use the string function. 

                    Still a happy camper. Now I know. And you know.

                    And yeah......weirdo guy rambling in the middle of the night.

                     

                    Goodnight (for real this time)!

                    Thanks phil!

                    My greatest accomplishment is teaching cats about Vienna Sausage. When I need a friend, all I need do is walk outside, pop open a can, and every little critter in the neighborhood drops by to say "Hi!"

                      Avatar

                      United States
                      Member #41846
                      June 23, 2006
                      459 Posts
                      Offline
                      Posted: November 11, 2016, 6:35 am - IP Logged

                      sorry I caused you to lose sleep.  I wrote that close to my bedtime and off top of my head and dropped a step.  the $ string indicator is required with left right mid commands.

                        garyo1954's avatar - garyo
                        Dallas, Texas
                        United States
                        Member #4549
                        May 2, 2004
                        1701 Posts
                        Offline
                        Posted: November 11, 2016, 12:08 pm - IP Logged

                        sorry I caused you to lose sleep.  I wrote that close to my bedtime and off top of my head and dropped a step.  the $ string indicator is required with left right mid commands.

                        Not a problem at all my friend.

                        It was worth knowing. And I wasn't going anywhere.

                        This afternoon I can settle in and work.

                        G

                        My greatest accomplishment is teaching cats about Vienna Sausage. When I need a friend, all I need do is walk outside, pop open a can, and every little critter in the neighborhood drops by to say "Hi!"

                          garyo1954's avatar - garyo
                          Dallas, Texas
                          United States
                          Member #4549
                          May 2, 2004
                          1701 Posts
                          Offline
                          Posted: November 11, 2016, 5:36 pm - IP Logged

                          NEW UPLOAD....

                           

                          DigiPair

                           

                          This utility(?) Program helps you eliminate

                          a digit

                          combos in a set sum range

                          up to 10 pairs

                          all even

                          all odd

                          all high

                          all low

                          double

                          triples

                          self extracting file.

                          Nope, it won't predict the Pick 3 numbers. But it will eliminate everything you want and tell you just what's left to play.

                          G

                          My greatest accomplishment is teaching cats about Vienna Sausage. When I need a friend, all I need do is walk outside, pop open a can, and every little critter in the neighborhood drops by to say "Hi!"

                            Sunglasses's avatar - nicebear
                            Zaperlopopotam
                            Belgium
                            Member #173932
                            March 26, 2016
                            958 Posts
                            Offline
                            Posted: November 11, 2016, 5:53 pm - IP Logged

                            But I only want you to give the winning straight combination!

                            No No

                            .
                              garyo1954's avatar - garyo
                              Dallas, Texas
                              United States
                              Member #4549
                              May 2, 2004
                              1701 Posts
                              Offline
                              Posted: November 11, 2016, 6:20 pm - IP Logged

                              But I only want you to give the winning straight combination!

                              No No

                              You want fries with that?

                              Just downloaded it to Windows 10, tried to open it....it gave a warning.

                              Click more info and extract it.

                              Runs fine. Looks a little different than Win7, but does the same stuff.

                              My greatest accomplishment is teaching cats about Vienna Sausage. When I need a friend, all I need do is walk outside, pop open a can, and every little critter in the neighborhood drops by to say "Hi!"