Last active
August 29, 2015 14:09
-
-
Save zmughal/e531070e61d593663ce3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Iteration is a pesky thing...it makes your algorithms slow. So what if I could | |
calculate factorials without iteration? | |
Save the following in a file, `chmod a+x` it and run like `./fact.pl 5` | |
Just don't pass in negative numbers or you'll slowly use up system resources. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
$_ = shift and print $_*`$0 @{[$_-1]}`||1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment