Well, I had thought that perhaps Algorithm::Permute might be the answer, but according to its documentation, so far it only deals with n arrangements of n items. Given that, and the amount of time it can take for even a small set of matches, I tossed together the following, based fairly closely on its docs. I *DO NOT* recommend this method (because it is highly inefficient, in just about every way I can think of).

#!/usr/bin/perl -w use strict; use Algorithm::Permute; $| = 1; my @spinner = ('|', '/', '-', '\\'); my $bigscale = 100_000; my $scale = 100; my $index = 0; my $draw_max = 9; my $draw_min = 1; my $to_draw = 6; my (%seen); my (@res); my $p = new Algorithm::Permute([$draw_min .. $draw_max]); while (@res = $p->next) { my $st = join(', ', sort(@res[0 .. ($to_draw - 1)])); $seen{$st} = 1; print $spinner[($index++ / $scale) % 4], "\b"; print '.' unless ($index % $bigscale); } print join "\n", sort keys %seen;

In reply to Re: Lottery combinations golf by atcroft
in thread Lottery combinations golf by Cody Pendant

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.