diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-11-13 10:08:57 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-11-13 10:08:57 -0800 |
commit | c603cd6cef43100aa83a62e15f96fd54c9fb987e (patch) | |
tree | d8631b1964a0200d170a996314f6e023686ff8de /html/factorial.mu.html | |
parent | 05d3592047a76db4cc8d77102508c21ca1b86e7b (diff) | |
download | mu-c603cd6cef43100aa83a62e15f96fd54c9fb987e.tar.gz |
2430 - make room for more transforms
Diffstat (limited to 'html/factorial.mu.html')
-rw-r--r-- | html/factorial.mu.html | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/html/factorial.mu.html b/html/factorial.mu.html index 31ac9c26..db6840b9 100644 --- a/html/factorial.mu.html +++ b/html/factorial.mu.html @@ -40,9 +40,9 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Constant">]</span> ] -<span class="muRecipe">recipe</span> factorial [ +<span class="muRecipe">recipe</span> factorial n:number<span class="muRecipe"> -> </span>result:number [ <span class="Constant">local-scope</span> - n:number<span class="Special"> <- </span><span class="Constant">next-ingredient</span> + <span class="Constant">load-ingredients</span> <span class="Delimiter">{</span> <span class="Comment"># if n=0 return 1</span> zero?:boolean<span class="Special"> <- </span>equal n, <span class="Constant">0</span> @@ -52,8 +52,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># return n * factorial(n-1)</span> x:number<span class="Special"> <- </span>subtract n, <span class="Constant">1</span> subresult:number<span class="Special"> <- </span>factorial x - result:number<span class="Special"> <- </span>multiply subresult, n - <span class="muControl">reply</span> result + result<span class="Special"> <- </span>multiply subresult, n ] <span class="Comment"># unit test</span> |