From f5465e1220d73e237c51897b7d1211ec53b0dc04 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 7 Sep 2015 10:37:27 -0700 Subject: 2177 --- html/factorial.mu.html | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) (limited to 'html/factorial.mu.html') diff --git a/html/factorial.mu.html b/html/factorial.mu.html index 30cf628b..d3837c22 100644 --- a/html/factorial.mu.html +++ b/html/factorial.mu.html @@ -13,10 +13,13 @@ 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; } -.Special { color: #ff6060; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } .Comment { color: #9090ff; } -.Underlined { color: #c000c0; text-decoration: underline; } -.Identifier { color: #804000; } +.Constant { color: #00a0a0; } +.Special { color: #ff6060; } +.Delimiter { color: #a04060; } +.muControl { color: #c0a020; } --> @@ -30,36 +33,36 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
 # example program: compute the factorial of 5
 
-recipe main [
-  local-scope
-  x:number <- factorial 5
-  $print [result: ], x, [
-]
+recipe main [
+  local-scope
+  x:number <- factorial 5
+  $print [result: ], x, [ 
+]
 ]
 
-recipe factorial [
-  local-scope
-  n:number <- next-ingredient
-  {
+recipe factorial [
+  local-scope
+  n:number <- next-ingredient
+  {
     # if n=0 return 1
-    zero?:boolean <- equal n, 0
-    break-unless zero?
-    reply 1
-  }
+    zero?:boolean <- equal n, 0
+    break-unless zero?
+    reply 1
+  }
   # return n * factorial(n-1)
-  x:number <- subtract n, 1
+  x:number <- subtract n, 1
   subresult:number <- factorial x
   result:number <- multiply subresult, n
-  reply result
+  reply result
 ]
 
 # unit test
-scenario factorial-test [
+scenario factorial-test [
   run [
-    1:number <- factorial 5
+    1:number <- factorial 5
   ]
   memory-should-contain [
-    1 <- 120
+    1 <- 120
   ]
 ]
 
-- cgit 1.4.1-2-gfad0