Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make iteration and recursion a bit longer so they measure something m…

…ore meaningful. Add iteration-for.p6.
  • Loading branch information...
commit 42f21fad18212f1b6f4c7f512292fc850c609816 1 parent b8c318b
Patrick R. Michaud pmichaud authored
Showing with 8 additions and 3 deletions.
  1. +4 −0 iteration-for.p6
  2. +1 −1  iteration.p6
  3. +3 −2 recursion.p6
4 iteration-for.p6
View
@@ -0,0 +1,4 @@
+use v6;
+
+for 1..5000 { $_ };
+
2  iteration.p6
View
@@ -1,5 +1,5 @@
use v6;
my $i = 0;
-while $i < 5 { $i++; };
+while $i < 5000 { $i++; };
5 recursion.p6
View
@@ -1,4 +1,5 @@
use v6;
-sub recur($n) { say $n; recur($n-1) if $n>0; }
-recur(12);
+my $x = 0;
+sub recur($n) { say $x++; recur($n-1) if $n>0; recur($n-1) if $n>0; }
+recur(9);
Please sign in to comment.
Something went wrong with that request. Please try again.