aboutsummaryrefslogtreecommitdiff
path: root/challenge-030
diff options
context:
space:
mode:
authorMohammad S Anwar <mohammad.anwar@yahoo.com>2019-10-14 14:19:45 +0100
committerMohammad S Anwar <mohammad.anwar@yahoo.com>2019-10-14 14:19:45 +0100
commit45c4b2f1edb37ad26bf8ac1f14b0c170ea21b2b6 (patch)
tree00c3425f1ad09f3ac0e3799ccbcb4a9d8c675188 /challenge-030
parent5646bd5a3b8f0d88c6d988e8df37c7f004cd1b9c (diff)
downloadperlweeklychallenge-club-45c4b2f1edb37ad26bf8ac1f14b0c170ea21b2b6.tar.gz
perlweeklychallenge-club-45c4b2f1edb37ad26bf8ac1f14b0c170ea21b2b6.tar.bz2
perlweeklychallenge-club-45c4b2f1edb37ad26bf8ac1f14b0c170ea21b2b6.zip
- Added solution by Pete Houston.
Diffstat (limited to 'challenge-030')
-rw-r--r--challenge-030/pete-houston/perl5/ch-2.pl14
1 files changed, 14 insertions, 0 deletions
diff --git a/challenge-030/pete-houston/perl5/ch-2.pl b/challenge-030/pete-houston/perl5/ch-2.pl
new file mode 100644
index 0000000000..e380542eee
--- /dev/null
+++ b/challenge-030/pete-houston/perl5/ch-2.pl
@@ -0,0 +1,14 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+my $sum = 12;
+for my $marker (0 .. $sum) {
+ for my $iter ($marker .. $sum - $marker) {
+ my @set = ($marker, $iter, $sum - $iter - $marker);
+ next if $set[2] < $set[1];
+ next unless grep { $_ % 2 == 0 } @set;
+ print "@set\n";
+ }
+}
+