diff options
| author | Jörg Sommrey <28217714+jo-37@users.noreply.github.com> | 2023-12-04 21:11:43 +0100 |
|---|---|---|
| committer | Jörg Sommrey <28217714+jo-37@users.noreply.github.com> | 2023-12-08 16:12:38 +0100 |
| commit | 386b3ad38c111fef322833798895d797283ed043 (patch) | |
| tree | cf337d484e89577abee792855b6f48dd19acfc4a /challenge-246 | |
| parent | 2557822359d7d64adbba70616fcd2351bd1d7302 (diff) | |
| download | perlweeklychallenge-club-386b3ad38c111fef322833798895d797283ed043.tar.gz perlweeklychallenge-club-386b3ad38c111fef322833798895d797283ed043.tar.bz2 perlweeklychallenge-club-386b3ad38c111fef322833798895d797283ed043.zip | |
Solution to task 1
Diffstat (limited to 'challenge-246')
| -rwxr-xr-x | challenge-246/jo-37/perl/ch-1.pl | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/challenge-246/jo-37/perl/ch-1.pl b/challenge-246/jo-37/perl/ch-1.pl new file mode 100755 index 0000000000..ba06467be3 --- /dev/null +++ b/challenge-246/jo-37/perl/ch-1.pl @@ -0,0 +1,20 @@ +#!/usr/bin/perl + +use v5.11; +use warnings; + + +### Input and Output + +srand time; +say for sixoutoffortynine(); + + +### Implementation + +sub sixoutoffortynine { + my @pool = (1..49); + my @winning; + push @winning, splice @pool, rand @pool, 1 for 1 .. 6; + sort {$a <=> $b} @winning; +} |
