From 386b3ad38c111fef322833798895d797283ed043 Mon Sep 17 00:00:00 2001 From: Jörg Sommrey <28217714+jo-37@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:11:43 +0100 Subject: Solution to task 1 --- challenge-246/jo-37/perl/ch-1.pl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 challenge-246/jo-37/perl/ch-1.pl 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; +} -- cgit