aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2019-06-09 05:46:25 +0100
committerGitHub <noreply@github.com>2019-06-09 05:46:25 +0100
commit53595f22a16f5392de7996d4ba6f87f06d480f31 (patch)
tree4ed8c295b195fe3b2ae9630721aa77e13d11a69f
parent8cdc531858dfa1b8f3c6c90a1d3058a92bfd8f78 (diff)
parentf70444df60782c54955c25d7b462b002a16fa498 (diff)
downloadperlweeklychallenge-club-53595f22a16f5392de7996d4ba6f87f06d480f31.tar.gz
perlweeklychallenge-club-53595f22a16f5392de7996d4ba6f87f06d480f31.tar.bz2
perlweeklychallenge-club-53595f22a16f5392de7996d4ba6f87f06d480f31.zip
Merge pull request #231 from adamcrussell/challenge-011
solution for challenge 011
-rw-r--r--challenge-011/adam-russell/blog.txt1
-rw-r--r--challenge-011/adam-russell/perl5/ch-1.pl14
-rw-r--r--challenge-011/adam-russell/perl5/ch-2.pl18
3 files changed, 33 insertions, 0 deletions
diff --git a/challenge-011/adam-russell/blog.txt b/challenge-011/adam-russell/blog.txt
new file mode 100644
index 0000000000..1b39aba56b
--- /dev/null
+++ b/challenge-011/adam-russell/blog.txt
@@ -0,0 +1 @@
+https://adamcrussell.livejournal.com/3900.html
diff --git a/challenge-011/adam-russell/perl5/ch-1.pl b/challenge-011/adam-russell/perl5/ch-1.pl
new file mode 100644
index 0000000000..a723c744a4
--- /dev/null
+++ b/challenge-011/adam-russell/perl5/ch-1.pl
@@ -0,0 +1,14 @@
+use strict;
+use warnings;
+##
+# Write a script that computes the equal point in the Fahrenheit and Celsius
+# scales, knowing that the freezing point of water is 32 °F and 0 °C, and
+# that the boiling point of water is 212 °F and 100 °C.
+# °F = (°C * 9/5) + 32
+##
+for my $c (-100 .. 100){
+ my $f = ($c * (9/5)) + 32;
+ if($f == $c){
+ print "°F = °C at $f\n";
+ }
+}
diff --git a/challenge-011/adam-russell/perl5/ch-2.pl b/challenge-011/adam-russell/perl5/ch-2.pl
new file mode 100644
index 0000000000..d29c2bf377
--- /dev/null
+++ b/challenge-011/adam-russell/perl5/ch-2.pl
@@ -0,0 +1,18 @@
+use strict;
+use warnings;
+##
+# Write a script to create an Identity Matrix for the given size.
+# For example, if the size is 4, then create Identity Matrix 4x4.
+##
+use constant SIZE => 10;
+
+my @a;
+for my $i (0 .. SIZE - 1){
+ my @b = (0) x SIZE;
+ $b[$i] = 1;
+ push @a, \@b;
+}
+print SIZE . " x " . SIZE . " identity matrix:\n";
+for my $i (0 .. SIZE - 1){
+ print "\t" . join(" ", @{$a[$i]}) . "\n";
+}