All pastes #100238 Raw Edit

Someone

public python v1 · immutable
#100238 ·published 2006-07-25 23:10 UTC
rendered paste body
#!/usr/bin/python# lotto picker by manny juan  (juanm@wellsfargo.com or manny@bdt.com)from random import randintdef pick_lotto():  maxm=55; maxj=5; j = final_run = roll = 0; lastn = [14,40,47,54,55,6]#  maxm=5; maxj=5; j = final_run = roll = 0; lastn = [1,2,3,4,5,1]  while j <= roll:    v=[]    m=maxm    # create all numbers from 0 to m    r=range(m+1)    for k in range(maxj):      # get ith number from r...      i=randint(1,m)      n=r[i]      # move last elem to hole...      r[i]=r[m]      m -= 1      # and append to the result      v.append(n)    if not final_run:      v.sort()      v.append(randint(1,42))      if v != lastn:        j += 1; roll += 1      else:        j = 0; final_run = 1    else:      j += 1; randint(1,42)  v.sort()  v.append(randint(1,42))  print v, j - 1, roll, "146,107,961 Win"  return# immediate-mode commands, for drag-and-drop or execfile() executionif __name__ == '__main__':        for i in range(1):                pick_lotto()else:        print "Module lotto imported."        print "To run, type: lotto.run()"        print "To reload after changes to the source, type: reload(lotto)"# end of lotto.py