aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-146/james-smith/perl/ch-1.pl14
-rw-r--r--challenge-146/james-smith/perl/ch-2.pl22
2 files changed, 36 insertions, 0 deletions
diff --git a/challenge-146/james-smith/perl/ch-1.pl b/challenge-146/james-smith/perl/ch-1.pl
new file mode 100644
index 0000000000..fe3c61704e
--- /dev/null
+++ b/challenge-146/james-smith/perl/ch-1.pl
@@ -0,0 +1,14 @@
+#!/usr/local/bin/perl
+
+use strict;
+
+use warnings;
+use feature qw(say);
+
+my @primes = (2);
+
+for( my $c=3; @primes<10001; $c+=2 ) {
+ ($_>sqrt$c)?((push@primes,$c),last):$c%$_||last for @primes;
+}
+
+say $primes[-1];
diff --git a/challenge-146/james-smith/perl/ch-2.pl b/challenge-146/james-smith/perl/ch-2.pl
new file mode 100644
index 0000000000..2348c8b946
--- /dev/null
+++ b/challenge-146/james-smith/perl/ch-2.pl
@@ -0,0 +1,22 @@
+#!/usr/local/bin/perl
+
+use strict;
+
+use warnings;
+use feature qw(say);
+use Test::More;
+use Benchmark qw(cmpthese timethis);
+use Data::Dumper qw(Dumper);
+
+my @TESTS = (
+ [ 0, 1 ],
+);
+
+is( my_function($_->[0]), $_->[1] ) foreach @TESTS;
+
+done_testing();
+
+sub my_function {
+ return 1;
+}
+