From a5df1d5e9605c44e2fd909c192aa8336c66fa103 Mon Sep 17 00:00:00 2001 From: Jörg Sommrey <28217714+jo-37@users.noreply.github.com> Date: Mon, 1 Jan 2024 16:46:21 +0100 Subject: Solution to task 1 --- challenge-250/jo-37/perl/ch-1.pl | 63 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100755 challenge-250/jo-37/perl/ch-1.pl diff --git a/challenge-250/jo-37/perl/ch-1.pl b/challenge-250/jo-37/perl/ch-1.pl new file mode 100755 index 0000000000..e734e957f3 --- /dev/null +++ b/challenge-250/jo-37/perl/ch-1.pl @@ -0,0 +1,63 @@ +#!/usr/bin/perl -s + +use v5.24; +use Test2::V0; + +our ($tests, $examples, $base); + +run_tests() if $tests || $examples; # does not return + +die < 0, 1, 2), 0, 'example 1'; + is smallest_index(10,=> 4, 3, 2, 1), 2, 'example 2'; + is smallest_index(10,=> 1, 2, 3, 4, 5, 6, 7, 8, 9, 0), -1, 'example 3'; + } + + SKIP: { + skip "tests" unless $tests; + + is smallest_index(2,=> 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1), 9, 'base 2'; + } + + done_testing; + exit; +} -- cgit From 9b5cce9791d577bc1c1b9eb29af0b3db15866ce8 Mon Sep 17 00:00:00 2001 From: Jörg Sommrey <28217714+jo-37@users.noreply.github.com> Date: Mon, 1 Jan 2024 16:46:39 +0100 Subject: Solution to task 2 --- challenge-250/jo-37/perl/ch-2.pl | 54 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 challenge-250/jo-37/perl/ch-2.pl diff --git a/challenge-250/jo-37/perl/ch-2.pl b/challenge-250/jo-37/perl/ch-2.pl new file mode 100755 index 0000000000..e94254968c --- /dev/null +++ b/challenge-250/jo-37/perl/ch-2.pl @@ -0,0 +1,54 @@ +#!/usr/bin/perl -s + +use v5.24; +use Test2::V0; +use List::Util 'max'; + +our ($tests, $examples); + +run_tests() if $tests || $examples; # does not return + +die < Date: Wed, 3 Jan 2024 21:49:58 +0100 Subject: Blog for challenge 250 --- challenge-250/jo-37/blog.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 challenge-250/jo-37/blog.txt diff --git a/challenge-250/jo-37/blog.txt b/challenge-250/jo-37/blog.txt new file mode 100644 index 0000000000..63892b4690 --- /dev/null +++ b/challenge-250/jo-37/blog.txt @@ -0,0 +1 @@ +https://github.sommrey.de/blog/pwc/challenge-250 -- cgit