diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-10-02 00:34:44 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-10-02 00:34:44 -0700 |
commit | 662d2a27d14115956015334eae786b74304cfbb8 (patch) | |
tree | 857b8ca8b7f4f592b2307f7a9bd230d96972fcfc | |
parent | af7a5722df4b71f679bd2bae40601916682bbb59 (diff) | |
download | mu-662d2a27d14115956015334eae786b74304cfbb8.tar.gz |
2235
-rw-r--r-- | tangle.mu | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tangle.mu b/tangle.mu index b9d05bee..88722185 100644 --- a/tangle.mu +++ b/tangle.mu @@ -10,19 +10,19 @@ recipe factorial [ local-scope n:number <- next-ingredient { - +base-case + <base-case> } - +recursive-case + <recursive-case> ] -after +base-case [ +after <base-case> [ # if n=0 return 1 zero?:boolean <- equal n, 0 break-unless zero? reply 1 ] -after +recursive-case [ +after <recursive-case> [ # return n * factorial(n - 1) x:number <- subtract n, 1 subresult:number <- factorial x |