Permalink
Browse files

Add perl 6 stuff

  • Loading branch information...
1 parent 50b8897 commit 5635ab5d8ef71b7f8f81bec73c05ed506f5a09dc @leto leto committed Jul 12, 2009
Showing with 32 additions and 0 deletions.
  1. +7 −0 README
  2. +2 −0 perl6/001_01.pl
  3. +6 −0 perl6/001_02.pl
  4. +6 −0 perl6/001_03.pl
  5. +5 −0 perl6/001_04.pl
  6. +6 −0 perl6/001_05.pl
View
7 README
@@ -0,0 +1,7 @@
+This is a rapidly developing benchmark suite for perl 5 and perl 6
+solutions to programming problems from http://projecteuler.net/.
+
+File in each directory are named according to:
+
+<3-digit project euler number>.<2-digit implementation number>.pl
+
View
2 perl6/001_01.pl
@@ -0,0 +1,2 @@
+say [+] grep { $_ % 3 == 0 or $_ % 5 == 0}, (1..1000);
+
View
6 perl6/001_02.pl
@@ -0,0 +1,6 @@
+my $s = 0;
+for (1..1000) {
+ $s += $_ if $_ % 3 == 0 or $_ % 5 == 0
+}
+say $s;
+
View
6 perl6/001_03.pl
@@ -0,0 +1,6 @@
+my $s = 0;
+for (1..1000) {
+ $s += $_ if $_ % 3 == 0 || $_ % 5 == 0;
+}
+say $s;
+
View
5 perl6/001_04.pl
@@ -0,0 +1,5 @@
+my $s = 0;
+for (1..1000) {
+ $s += $_ if $_ % 3 == 0 or $_ % 5 == 0
+}
+say $s;
View
6 perl6/001_05.pl
@@ -0,0 +1,6 @@
+my $s = 0;
+$s += $_ for grep { $_ % 3 == 0 or $_ % 5 == 0}, (1..1000);
+say $s;
+
+
+

0 comments on commit 5635ab5

Please sign in to comment.