This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl6 | |
| ##################################################################### | |
| ## Michael D. Hensley | |
| ## March 27, 2012 | |
| ## | |
| ## Mega Millions loto number random picker | |
| ## Pick 5 numbers from 1 to 56 and 1 number from 1 to 46 | |
| ## | |
| ##################################################################### | |
| use v6; use Term::ANSIColor; use Test; | |
| ##################################################################### | |
| my $loop = 0; | |
| ##################################################################### | |
| sub pickNums () { | |
| print "{ [1..56].pick(5).sort; } MEGA Number: { [1..46].pick; } \n"; | |
| } | |
| ##################################################################### | |
| multi sub MAIN ($numPicks = 1) { | |
| while $loop < $numPicks { | |
| print "Quick Pick {$loop+1}\: "; pickNums; | |
| $loop++; | |
| } | |
| } | |
| ##################################################################### | |
| # End of file | |
| # vim: ft=perl6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment