add perl6 code for chapters 1-4 (#49)

This commit is contained in:
ryn1x
2018-01-04 07:46:31 -07:00
committed by Aditya Bhargava
parent dd0100e471
commit 7d48d29139
11 changed files with 194 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env perl6
use v6.c;
multi fact(1) { 1 }
multi fact($x where { $x > 1 }) { $x * fact($x-1) }
say fact(5);