Lottery Lotto Gambling Software Systems Forum Index Lottery Lotto Gambling Software Systems
Software for lotto, lottery software founded on theory of probability, mathematics.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 



Hit Table, combination generation....
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Lottery Lotto Gambling Software Systems Forum Index -> Software Systems Theory
View previous topic :: View next topic  
Author Message
thornc



Joined: 22 Aug 2006
Posts: 72
Location: Here...

PostPosted: Jan 08, 2007 07:27    Post subject: Hit Table, combination generation.... Reply with quote

or "The balance between time and strategies II"

Take the following code:
Code:

#!/usr/bin/env python
#
# Combination generation by Hit table seperation.
# At the moment works only for 6/49 games, and error handling is not implemented.
#
# Copyright (c) 2006 C.Lopes aka thornc. (except on given functions)
#
# Released under the MIT License.
# http://www.opensource.org/licenses/mit-license.php
#

import sys, os

def fact(n):
   if n<=0: return 1
   out = long(1)
   for x in xrange(1,n+1):
      out *= x
   return out
   
def comb(n,k):
   return ( fact(n) )/( (fact(k))*(fact(n-k) ) )


# Taken from Python cookbook
def histogram(seq):
    result = {}
    for x in seq:
        result.setdefault(x, 0)
        result[x] += 1
    return result

# Taken from Python cookbook   
def xuniqueCombinations(items, n):
    if n==0: yield []
    else:
        for i in xrange(len(items)-n+1):
            for cc in xuniqueCombinations(items[i+1:],n-1):
                yield [items[i]]+cc

def sortList(aList):
   aList.sort()
   return aList

def printUsage():
   a=\
"""
%s <Input file name> <Output file name> <Selection>
--
Input file name -> Name of the file to read and generate output from. Values inside
   must be seperated by space characters (" ").
Output file name -> Name of the file that will be created with the output.
Selection -> 3 digits that select how many numbers from each group. Sum must be 6.
   For example 222 or 123.
"""%(sys.argv[0],)
   print a


# Start...
#
if (len(sys.argv)!=4):
   printUsage()
   sys.exit()

tFile = sys.argv[1]
oFile = sys.argv[2]
sel   = sys.argv[3]

if not os.path.exists( tFile):
   print "File doesn't exist:", tfile
   sys.exit()
   
if len(sel) != 3:
   print "Selection must be 3 integers."
   sys.exit()
   
g1s = int(sel[0])
g2s = int(sel[1])
g3s = int(sel[2])
if (g1s+g2s+g3s)!= 6:
   print "Sum of Selection must be 6!"
   sys.exit()
   
   
fid = open(tFile,"r")
data=fid.readlines()
fid.close()

nums = []
for line in data:
   line = line.strip()
   num = [int(x) for x in line.split()]
   nums+=num


h = histogram(nums)
l = zip( h.values(), h.keys() )
l.sort()
l.reverse()


print '\n'.join(["\t%03d\t%02d" % (count, num) for (count, num) in l])
print "-"*25

g1 = [ y for (x,y) in l[0:6] ]
g1.sort()
g1l = len(g1)

g2 = [ y for (x,y) in l[6:24] ]
g2.sort()
g2l = len(g2)

g3 = [ y for (x,y) in l[24:] ]
g3.sort()
g3l = len(g3)

print "Group 1",g1l,g1
print "Group 2",g2l,g2
print "Group 3",g3l,g3

g1c = [ x for x in  xuniqueCombinations(g1,g1s)]
g2c = [ x for x in  xuniqueCombinations(g2,g2s)]
g3c = [ x for x in  xuniqueCombinations(g3,g3s)]
print "Total combs: ", comb(g1l,g1s)*comb(g2l,g2s)*comb(g3l,g3s)

ans = raw_input("Generate combinations (y/n)? ")
if (ans!="Y" and ans!="y"):
   print "Exiting..."
   sys.exit()

allcombs = [ sortList(x+y+z) for x in g1c for y in g2c for z in g3c]

fid = open(oFile,"wa")
for line in allcombs:
   fid.write( " ".join([ "%02d"%(x,) for x in line ])+"\n" )

fid.close()



Paste it into a file named for example HitTableGen.py (NOTE spaces/tabs matter); download and install Python (if you don't have it yet) and run this with something like:
Quote:

HitTableGen.py hist.txt out.txt 321

Be carefull that it might generate thounsands (even millions) of combinations.

The hist.txt can be a typical history file (don't remember the exact name) used in Saliu's programs.....

I have tested this both in Windows XP + Python 2.4.3 and Redhat Linux + Python 2.3.4; but it should work with any version of Python and OS.
I don't exclude the possibility that there might be some unfound bugs...

Have fun and ask feel free to ask questions....
_________________
Just ME here....
Back to top
View user's profile Send private message
thornc



Joined: 22 Aug 2006
Posts: 72
Location: Here...

PostPosted: Jan 08, 2007 07:29    Post subject: Reply with quote

Ion, something like this was what you were asking for.....
_________________
Just ME here....
Back to top
View user's profile Send private message
chelmi



Joined: 11 Sep 2006
Posts: 64

PostPosted: Jan 09, 2007 12:25    Post subject: software to generate unique combs from several subsets Reply with quote

thornc

Thanks for your python module to generate combs from 3 subsets.
I ran it. and generated combs.
The generated combs seem to have no relation with my hist.txt, which contains the sequence of all numbers in the lottery game - in a specific order resulting from Ion Saliu's Skipsystem.exe. The first 6 numbers defining group 1, the next 19 for group2 and the remaining ones for group3.
It looks like your python module does not take care of the hist.txt but rather defines the 3 groups in the natural order of the integer from 1 to 49.
the hist.txt file consists of 49 numbers separated by a " ".
Can you tell me what I am doing wrong?
Thanks
Chelmi
Back to top
View user's profile Send private message
thornc



Joined: 22 Aug 2006
Posts: 72
Location: Here...

PostPosted: Jan 09, 2007 14:36    Post subject: Re: software to generate unique combs from several subsets Reply with quote

chelmi wrote:

(...) hist.txt, which contains the sequence of all numbers in the lottery game - in a specific order resulting from Ion Saliu's Skipsystem.exe.
(...) Can you tell me what I am doing wrong


Well, the hist.txt should contain your history file... not the output from the SkipSystem.exe. In fact you should fee the script the same input you are feeding Saliu's SkipSystem.exe.

Hope this helps, let me know how it goes!
_________________
Just ME here....
Back to top
View user's profile Send private message
marcher
Site Admin


Joined: 19 May 2006
Posts: 530

PostPosted: Jan 09, 2007 17:35    Post subject: Reply with quote

Critser:

I assuredly appreciate your effort, super crocodilule & well-trained-in-programming colleague of mine. Thank you very much, indeed.

I have never programmed in Python. I figure out what your code does. I wonder if you would consider BASIC, more specifically PowerBasic Console Compiler (PBCC). You was highly trained in computer programming in college. You could make a very easy transition to PBCC.

There are huge advantages PBCC has over any other programming language.

First and foremost, PBCC is the fastest compiler out there — bar none, baby. When it comes to number processing, nothing can challenge PBCC (except for assembly, but programming in assembly has become an impossibility for serious projects). If you read the thread regarding the new MDIEditor, Visual Basic is unable to do in days and nights what PBCC can do in minutes!

Secondly, PBCC is the easiest to read programming language. Even neophytes can get a good handle in a short time. Thus, more people could enter the cooperating act you just started.

Thirdly, I could compile the code in quick stages. PBCC compiles a program like SkipDecaFreq6.EXE in just 0.5 seconds! The EXE size is also compact. I could upload the latest compilations in seconds.

If I understand your code correctly, it does what it should do:

1) Take a lottery history file (something like Data-6 in LotWon);
2) Do a frequency analysis;
~ problem here is the range of analysis; your code analyzes the entire file (right?); the code should ask the user for a parpaluck;
3) the program sorts all lotto numbers in descending order based on frequency;
4) the program divides the sorted numbers in three groups; should be 6, 18, 25 (for a lotto 6/49 game); 6 in the first group is the minimum;
5) the program generates combinations from 1 to C(N, 6); if the user wants to see the combos, he/she must choose ‘Y’ or ‘y’ when prompted "Generate combinations (y/n)? "

This is a working program, super crocodilule! Give it to the world in PBCC form. Many will thank you and cooperate!

Your code, Critser, should become a module of a larger program. The larger program should first generate the frequency reports. That is, break down a lotto-6 drawing as a 1-2-3 string (total = 6 numbers from 3 frequency groups). After the reports are done, the program should check a strategy. That is, how a frequency 1-2-3 string fared in the past. The strategy checking module looks at the 1-2-3 reports generated in the first step. Three: after the strategy checking, look at the data file and see how many combinations the strategy would have generated in the hit situations. Fourth, generate combinations in lexicographical order (like your source code does). Sixth, generate random combinations for a particular strategy. Finally, purge an output file generated by LotWon, or MDIEditor And Lotto WE, or any other lottery program that generates output files in the universal text format.

By the way, you can add some inner filters to the fray. For example:
1) The sum should be between N*1 and N*5 for lotto-6 (e.g. between 49 and 245 for 6/49 lotto);
2) No more than 4 or 5 or 6 deltas; that is, no more than 4 lotto-6 numbers should be differentiated by the same amount; e.g. no 2-4-6-8-10-39 type of combinations.

Critser, Super Lusitanule, you did an honorable thing. Hopefully, your example will be followed up.

This is the busiest time of year for me. I will still find adequate time to participate.

Best of luck from Parpaluck!

Ion Saliu,
Python-Constrictor At-Large
PS
Critser,
Have you read Gabriel Garcia Marquez’ “A Hundred Years Of Solitude”? It is the greatest novel ever written, in my book. There is an omnipresent character in that novel — virtually in all Garcia Marquez’ writings. The character has no name, but a clear definition. He is ‘El Marinero Portugues’ — or something like that. El Marinero Portugues is everywhere the action is. I mention this because I remember you was everywhere a lotto forum has ever been open. People told me about it. I also googled and find El ThornC in many places lottery…
Boa suerte!
IS

PSS
There is a speedy path from my hometown. I can order a new PBCC via my PayPal and have you download it to your email. Or, I could email it to you as an attachment. You would have full rights over your PBCC copy. That’s how things should always work. I do, you do, how do you do?
IS


Last edited by marcher on Jan 09, 2007 18:35; edited 1 time in total
Back to top
View user's profile Send private message
thornc



Joined: 22 Aug 2006
Posts: 72
Location: Here...

PostPosted: Jan 09, 2007 18:26    Post subject: Reply with quote

Hi Ion,

marcher wrote:

I have never programmed in Python. I figure out what your code does. I wonder if you would consider BASIC, more specifically PowerBasic Console Compiler (PBCC). You was highly trained in computer programming in college. You could make a very easy transition to PBCC.
(...)

Well I don't think I can/want to learn yet another programming language, since I now something C/C++,Java,XSL/XQL, Python and some others. I still remember some Basic and Pascal, but if I would compile such a program it would be in either C++ or Java, mostly because of the free compilers available. In any case Python is the best prototyping language I know and its fast enough for most purposes.

marcher wrote:

If I understand your code correctly, it does what it should do:

1) Take a lottery history file (something like Data-6 in LotWon);
2) Do a frequency analysis;
~ problem here is the range of analysis; your code analyzes the entire file (right?); the code should ask the user for a parpaluck;
3) the program sorts all lotto numbers in descending order based on frequency;
4) the program divides the sorted numbers in three groups; should be 6, 18, 25 (for a lotto 6/49 game); 6 in the first group is the minimum;
5) the program generates combinations from 1 to C(N, 6); if the user wants to see the combos, he/she must choose ‘Y’ or ‘y’ when prompted "Generate combinations (y/n)? "

You are correct, this is what it does. Like you say in 2, it reads the full file and all the values in the line (this was done on purpose, because like this you can use bonus numbers...). If one wants to limit the number of lines to look at, one can either create a file with just the number of lines one wants or change the line "for line in data: " to something line "for line in data[0:N]:" where N should be the number of lines to look at... for example 50.

marcher wrote:

Your code, Critser, should become a module of a larger program. The larger program should first generate the frequency reports. That is, break down a lotto-6 drawing as a 1-2-3 string (total = 6 numbers from 3 frequency groups). After the reports are done, the program should check a strategy. That is, how a frequency 1-2-3 string fared in the past. The strategy checking module looks at the 1-2-3 reports generated in the first step. Three: after the strategy checking, look at the data file and see how many combinations the strategy would have generated in the hit situations. Fourth, generate combinations in lexicographical order (like your source code does).

Well I already developed something that does what you call frequency reports and checks the "strategies"; in fact this is simplified version of that. At the moment I'm still not ready to put that one in the "world wild web" yet... needs to be improved.

marcher wrote:

By the way, you can add some inner filters to the fray.

Thanks for the filter ideas.

I will try to share something else "soon"; meanwhile I thing this is enough to get people going.
_________________
Just ME here....
Back to top
View user's profile Send private message
marcher
Site Admin


Joined: 19 May 2006
Posts: 530

PostPosted: Jan 09, 2007 19:31    Post subject: Reply with quote

Critser:

You was writing your reply while I was editing my first post! Please reread the edits. Thanks for your reply, however.

As you — and most who know me — know — I never worship anything or anybody. I make a case for PowerBasic basically because it is the best compiler out there. The guys at PowerBasic, Inc. don’t even know anything about this thread. Matter of fact, I kicked their butts big time a few years ago. I looked like a nasty SOB, but I am glad I did what I did. PBCC became a significantly better compiler with a significantly better help facility. I still kick Bitser arse from time to time. I do it for a good reason. He (Bitser, the only force behind PBCC) always improves his act…

Please accept my PBCC gift to you. You would do the same thing, if I were El Marinero Portugues.

Personally, I want PowerBasic to stay alive. I regret I did not do my best regarding Lotus 1-2-3 or WordPerfect. They are dead and Billy “Greedy Crocodile” Blitser Gates has destroyed just about everything in the software greenhouse.

You was a kid, Critser, in the 1980’s, early 1990’s. The famed-but-now-almost-Microsoft-caused-dead ‘PC Magazine’ ran a compiler test in 1993. PowerBasic came in first way ahead of anybody else. It was called Turbo Basic a few years earlier. It has always been the brainchild of a loner complier geek in the best meaning of the term: Bob “Bitser” Zale. If genius is a real thing, then Bitser Zale is a compiler genius. Don’t you ever call him Blitser! You would bang heads with me, crocodilule! Don’t you know who Blitser is?

Bitser Zale has a forum and I always call him Bitser in his forum. I would disrespect him if I would call him any mundane name — such as Bob Zale. I want him to stay alive as the compiler wonder kid. Microsoft could have bought and thusly destroyed him for more than a decade now (we not talking lotto decades here). Microsoft did not buy Bitser because of serious and dangerous considerations on Blitser’s part.

First and foremost, antitrust considerations. Microsoft smothered Apple Computer in the 1980’s when Apple was developing Object Basic, a deadly threat to Microsoft BASIC — and perhaps Microsoft as a whole barrel. Blitser Gates would have not survived more than five years in the 1980’s without the BASIC interpreter — and compilers eventually. Blitser Gates’ claim to fame is BASIC creations such as DONKEY.BAS.

Secondly, it is a personal thing. Blitser Gates feels like he wants, now, finally, put up a fight as boy versus boy. He doesn’t want to go down the Hamlet down way as a coward. Buying PB would certainly look like that. Personally, I want to make sure that PowerBasic stays alive. PB can fairly easily convert to Linux or even Mac. Competion, therefore diversity, stay alive…

I want everybody be aware of history and personal facts of life. You would better do, like me, preserve old copies of operating systems and compilers. I know, Blitser is in process of organizing now Mafia-like armies that make sure the human subjects always upgrade their Window. Soon, we’ll hear knock-knocks from the daily Window-cleaning police. There is a number of substances I am prepared to throw into their eyes…

Did you know that Blitser has banned me from anything Microsoft? Well, I thought I should let you know that incredulously factious truth. Save everything you can now at www.saliu.com. Save also pages of interest in this forum. It would be easy for Blitser to buy this forum. He might even attempt to buy my web host. If you had millions in one of your pant pockets, what would it amount to buying something for a penny?

But, guess, what? Blitser can’t buy nations at this time. Buy the time Blitser would get close to buying nations, Microspost (compost, that is) would be as powerful as WordStar!!! When WordStar was powerful, there was only WordStar around! At that time, Blitser was licking the arse shoes of Tandy Radio Shack!

O, tempora, o, mores!

Blitser et al.

I would like you take it in the historical perspective.

Ion Saliu,
The Historian At-Large
Back to top
View user's profile Send private message
chelmi



Joined: 11 Sep 2006
Posts: 64

PostPosted: Jan 10, 2007 16:13    Post subject: Re: software to generate unique combs from several subsets Reply with quote

Thornc wrote:

(...)

Well, the hist.txt should contain your history file... not the output from the SkipSystem.exe. In fact you should fee the script the same input you are feeding Saliu's SkipSystem.exe.

Hope this helps, let me know how it goes!


Ok, I misread your initial instructions. My apologizes.
Thanks again
Chelmi
Back to top
View user's profile Send private message
chelmi



Joined: 11 Sep 2006
Posts: 64

PostPosted: Jan 10, 2007 17:26    Post subject: Re: software to generate unique combs from several subsets Reply with quote

thornc wrote:

Hope this helps, let me know how it goes!


Just nice! never seen such high speed in generating output files of combs
Easy to modify the number of lines to read 50 lines for instance.
My favorite game is 5/50. I modified your code accordingly.

I wish you will have time to deliver the extended module as "defined" by Marcher in his last post.
Thanks
Back to top
View user's profile Send private message
marcher
Site Admin


Joined: 19 May 2006
Posts: 530

PostPosted: Jan 10, 2007 19:07    Post subject: Reply with quote

Super Crocodilule:

Sorry, but I have to step aside for a while. I am fighting a cold. It was unusually warm in November, December 2006 and the 1st week of 2007 — in my neck of the woods. Global warming was to blame, they said on radio and TV. At the same time, people were killed because of snowstorms and cold weather in other parts of USA (Colorado, Plains states…) The weather turned colder without notice — that’s what always gives me a nasty cold this time of year.

I wanted to say that yesterday and today I received some unusual emails, including a very long one in Portuguese! There are questions I can’t really answer. I have not tested Critser’s code with Python. I can’t do that now. People don’t believe that Critser’s code generates combinations as EXACTLY. For example, exactly 1 number from group 1, 2 numbers from group 2, and 3 numbers from group 3. The code would indicate to me (I am far from being knowledgeable in Python) that the code would generate combinations on an EXACTLY basis.

Code:
g1c = [ x for x in  xuniqueCombinations(g1,g1s)]
g2c = [ x for x in  xuniqueCombinations(g2,g2s)]
g3c = [ x for x in  xuniqueCombinations(g3,g3s)]


Everybody can check the accuracy by calculating TOTAL COMBINATIONS:

(combos_group_1 * combos_group_2 * combos_group_3)

Then, look at the frequency groups and the combination file.

The way Python works is really efficient and elegant — or is it, really? My PowerBasic code is much, much more complex! I’ll post a very good example here. In this example, NO numbers from group_1 are in the combinations:

Code:
'---- 0 numbers from group_1
           IF Freq1 = 0 THEN
‘---- IF the first number in the combo is from group_1, then
‘---- skip the generation and increase parameter_1 of the lotto combination
    FOR J=1 TO H1
    IF A=D1(1, J) THEN 431 
    NEXT J
‘---- same as for 1st lotto position; increase parameter_2
     FOR J=1 TO H1
    IF B=D1(1, J) THEN 432
    NEXT J
‘---- same as for 1st lotto position; increase parameter_3
     FOR J=1 TO H1
    IF C=D1(1, J) THEN 433
    NEXT J
‘---- same as for 1st lotto position; increase parameter_4
     FOR J=1 TO H1
    IF D=D1(1, J) THEN 434
    NEXT J
‘---- same as for 1st lotto position; increase parameter_5
     FOR J=1 TO H1
    IF E=D1(1, J) THEN 435
    NEXT J
'---- END of 0 numbers from group_1

'---- 1 number from group_1
‘----- etc.


Again, I wanna thank Critser for his taking the challenge. I wanna also thank Chelmi for his participation. He has Excel knowledge. I advise everybody with working knowledge of a spreadsheet to step up to a real programming language. There isn’t a big difference effort-wise, but the final-product difference is huge in the favor of a true programming language.

Best of luck!

Ion Saliu,
Coldly At-Large
Back to top
View user's profile Send private message
thornc



Joined: 22 Aug 2006
Posts: 72
Location: Here...

PostPosted: Jan 11, 2007 03:30    Post subject: Re: software to generate unique combs from several subsets Reply with quote

chelmi wrote:
Just nice! never seen such high speed in generating output files of combs

Python is fast, but it can't compete with a true compiled language that natively compiles the code. But Python is really good and elegant to implement these simple ideas in a fast way.

chelmi wrote:
Easy to modify the number of lines to read 50 lines for instance. My favorite game is 5/50. I modified your code accordingly.

Can you please post the changes you made (a simple explanation should be enough) so that others can see how it's done? I could do it myself, but I think that if everyone sees that a third-person can update the code they will feel more confortable doing it.

marcher wrote:
People don’t believe that Critser’s code generates combinations as EXACTLY. For example, exactly 1 number from group 1, 2 numbers from group 2, and 3 numbers from group 3. The code would indicate to me (I am far from being knowledgeable in Python) that the code would generate combinations on an EXACTLY basis.

Well in the tests that I have done, it does! I can understand such comments from people that do not know enough about Python and so don't understand some of the contructs I used... for example the "generators" (the yield keyword used in the xuniqueCombinations function {I thank its author that posted it on Python CookBook}) and "list comprehensions" ( the "[ x for x in aList]" statements ).
All these are features of Python that I used to make the code easy to implement and perhaps more efficient, nevertheless I tried not to use complex Python things ( some of which I don't even master yet ).

marcher wrote:
The way Python works is really efficient and elegant — or is it, really? My PowerBasic code is much, much more complex! (...)

The reason is that Python (like some other higher level languages) has buil-in types and constructs that simplify most of operations one needs to perform, moreover its a language that allows one to program in the paradigm one prefers or better suits the task (OO or procedural).
_________________
Just ME here....
Back to top
View user's profile Send private message
chelmi



Joined: 11 Sep 2006
Posts: 64

PostPosted: Jan 11, 2007 04:19    Post subject: Re: software to generate unique combs from several subsets Reply with quote

thornc wrote:
chelmi wrote:
Just nice! never seen such high speed in generating output files of combs

Python is fast, but it can't compete with a true compiled language that natively compiles the code. But Python is really good and elegant to implement these simple ideas in a fast way.

chelmi wrote:
Easy to modify the number of lines to read 50 lines for instance. My favorite game is 5/50. I modified your code accordingly.

Can you please post the changes you made (a simple explanation should be enough) so that others can see how it's done? I could do it myself, but I think that if everyone sees that a third-person can update the code they will feel more confortable doing it.



here is the part of the python code which I have modified to fit my needs for a game 5/50 and a parpaluck of 32.

g1s = int(sel[0])
g2s = int(sel[1])
g3s = int(sel[2])
if (g1s+g2s+g3s)!= 5:
print "Sum of Selection must be 5!"

sys.exit()


fid = open(tFile,"r")
data=fid.readlines()
fid.close()

nums = []
for line in data[0:32]:
line = line.strip()
num = [int(x) for x in line.split()]
nums+=num

Now What I would like to modify:
instead of having the 3 groups determined by the frequency routine, to enable a manual keyboard input for each of the subsets of numbers in the 3 groups.
Thornc: can you give me some direction on how to do that simply?

Thanks
Chelmi
Back to top
View user's profile Send private message
thornc



Joined: 22 Aug 2006
Posts: 72
Location: Here...

PostPosted: Jan 11, 2007 13:02    Post subject: Re: software to generate unique combs from several subsets Reply with quote

chelmi wrote:

(...) here is the part of the python code (...)

Well done

chelmi wrote:

Now What I would like to modify:
instead of having the 3 groups determined by the frequency routine, to enable a manual keyboard input for each of the subsets of numbers in the 3 groups.
Thornc: can you give me some direction on how to do that simply?


To do what you are asking, the program above would have to be changed considerable; depending on your exact requirements a better idea might be putting your numbers in a file with 3 lines (one per subset) and read that file, this can be done very easily (without error checking and number repetition checking) .

Simply remove everything between the "nums=[]" line and the "print "-"*25" line; after change the g1,g2 and g3 assignment lines to:
Code:

g1 = [int(x) for x in data[0].split()]
g2 = [int(x) for x in data[1].split()]
g3 = [int(x) for x in data[2].split()]


And that should do the trick... I doubled check and the output is obviously the same as the program in the initial post for the same groups.
Be warned that there is no control over duplicated numbers in input, nor of the length of each line... so you can end up with thousands of combinations on your hard disk (several mega bytes).
_________________
Just ME here....
Back to top
View user's profile Send private message
thornc



Joined: 22 Aug 2006
Posts: 72
Location: Here...

PostPosted: Jan 11, 2007 13:07    Post subject: Reply with quote

marcher wrote:
I wanted to say that yesterday and today I received some unusual emails, including a very long one in Portuguese! There are questions I can’t really answer.


I didn't notice this sentence before, I would appreciate that if anyone has questions related to this program or me to please ask them here, do not disturb Ion with these! Like he stated, he is not the best person to answer them... specially something written in Portuguese (which BTW is my mother language). I will even go as far as saying that one can PM directly if the matter is sensitive other wise, please let's share question in the open like chelmi has been doing.

Thanks.
_________________
Just ME here....
Back to top
View user's profile Send private message
chelmi



Joined: 11 Sep 2006
Posts: 64

PostPosted: Jan 11, 2007 18:15    Post subject: Re: software to generate unique combs from several subsets Reply with quote

thornc wrote:
chelmi wrote:

(...) here is the part of the python code (...)

Well done

chelmi wrote:

Now What I would like to modify:
instead of having the 3 groups determined by the frequency routine, to enable a manual keyboard input for each of the subsets of numbers in the 3 groups.
Thornc: can you give me some direction on how to do that simply?


To do what you are asking, the program above would have to be changed considerable; depending on your exact requirements a better idea might be putting your numbers in a file with 3 lines (one per subset) and read that file, this can be done very easily (without error checking and number repetition checking) .

Simply remove everything between the "nums=[]" line and the "print "-"*25" line; after change the g1,g2 and g3 assignment lines to:
Code:

g1 = [int(x) for x in data[0].split()]
g2 = [int(x) for x in data[1].split()]
g3 = [int(x) for x in data[2].split()]


And that should do the trick... I doubled check and the output is obviously the same as the program in the initial post for the same groups.
Be warned that there is no control over duplicated numbers in input, nor of the length of each line... so you can end up with thousands of combinations on your hard disk (several mega bytes).


A great thanks to you Thornc!
Can you confirm that the lines "between" the "nums=[]" line and the "print "-"*25" line must be deleted; thus leaving the lines nums=[] and print "-"*25?
That is what I did but I receive a syntax error with a pointer ^ under the name of the "tfile".
Or may be this error comes from the path? I must admit that I do not yet master the paths under python. the path is set up for c:\program files\python. the hist file is located under c:\ion\data.
I was successful yesterday but I forgot to write the commands I ran.
Any advice on the latter will be welcome, although I recognize that your role is not to teach us python.
Anyway thanks again
I found a dirty way to use your initial module: I create a text file with "fictious" combs made of my groups 1 2 and 3 preferences.Combs for group 1 are repeated 3 times; combs for group2 are repeated twice and finally combs for group3 are not repeated.Thus the modules finds the planned frequencies and generates the final combs! Ough!!!!
Back to top
View user's profile Send private message
Advertisement






PostPosted: Feb 09, 2010 11:02    Post subject:

Back to top
Display posts from previous:   
Post new topic   Reply to topic    Lottery Lotto Gambling Software Systems Forum Index -> Software Systems Theory All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Google




Powered by phpBB © 2001, 2005 phpBB Group

Forum hosted by phpBB now!
RSS 0.92 RSS feed | Forum directory | Set up a free forum! | Get a free Blog!
Support forum