diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-07-29 15:55:05 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-07-29 15:55:05 -0700 |
commit | 9570363aec35e187e2395b1760a4b94e71580ac9 (patch) | |
tree | 5b0d9cf65b5d5a403ab29e88535ba158efb276fe /html/tangle.mu.html | |
parent | b318b7fb127a2bdf3e394b315a45d339dc738447 (diff) | |
download | mu-9570363aec35e187e2395b1760a4b94e71580ac9.tar.gz |
1885
Diffstat (limited to 'html/tangle.mu.html')
-rw-r--r-- | html/tangle.mu.html | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/html/tangle.mu.html b/html/tangle.mu.html index 4c72404b..f4e8be60 100644 --- a/html/tangle.mu.html +++ b/html/tangle.mu.html @@ -13,12 +13,12 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 1.05em; } +.muRecipe { color: #ff8700; } .Delimiter { color: #a04060; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #ff6060; } .muControl { color: #c0a020; } -.muRecipe { color: #ff8700; } --> </style> @@ -49,22 +49,22 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muRecipe">after</span> +base-case [ <span class="Comment"># if n=0 return 1</span> - zero?:boolean<span class="Special"> <- </span>equal n:number, <span class="Constant">0:literal</span> - <span class="muControl">break-unless</span> zero?:boolean - <span class="muControl">reply</span> <span class="Constant">1:literal</span> + zero?:boolean<span class="Special"> <- </span>equal n, <span class="Constant">0</span> + <span class="muControl">break-unless</span> zero? + <span class="muControl">reply</span> <span class="Constant">1</span> ] <span class="muRecipe">after</span> +recursive-case [ <span class="Comment"># return n * factorial(n - 1)</span> - x:number<span class="Special"> <- </span>subtract n:number, <span class="Constant">1:literal</span> - subresult:number<span class="Special"> <- </span>factorial x:number - result:number<span class="Special"> <- </span>multiply subresult:number, n:number - <span class="muControl">reply</span> result:number + 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 ] <span class="muRecipe">recipe</span> main [ - 1:number<span class="Special"> <- </span>factorial <span class="Constant">5:literal</span> - $print <span class="Constant">[result: ]</span>, 1:number, [ + <span class="Constant">1</span>:number<span class="Special"> <- </span>factorial <span class="Constant">5</span> + $print <span class="Constant">[result: ]</span>, <span class="Constant">1</span>:number, [ ] ] </pre> |