From d44123cabaa730c778a0e2644c75dbfba6a7ab30 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 12 Jun 2015 22:34:45 -0700 Subject: 1556 --- html/factorial.mu.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'html/factorial.mu.html') diff --git a/html/factorial.mu.html b/html/factorial.mu.html index c57d4b62..22438340 100644 --- a/html/factorial.mu.html +++ b/html/factorial.mu.html @@ -13,13 +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: 1em; } +.muScenario { color: #00af00; } .Delimiter { color: #c000c0; } .Comment { color: #8080ff; } .Constant { color: #008080; } .Special { color: #ff6060; } -.Identifier { color: #008080; } +.muControl { color: #804000; } .muRecipe { color: #ff8700; } -.muScenario { color: #00af00; } --> @@ -34,26 +34,26 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } # example program: compute the factorial of 5 recipe main [ - default-space:address:array:location <- new location:type, 30:literal + default-space:address:array:location <- new location:type, 30:literal x:number <- factorial 5:literal - $print [result: ], x:number, [ + $print [result: ], x:number, [ ] ] recipe factorial [ - default-space:address:array:location <- new location:type, 30:literal - n:number <- next-ingredient + default-space:address:array:location <- new location:type, 30:literal + n:number <- next-ingredient { # if n=0 return 1 zero?:boolean <- equal n:number, 0:literal - break-unless zero?:boolean - reply 1:literal + break-unless zero?:boolean + reply 1:literal } # return n * factorial(n - 1) x:number <- subtract n:number, 1:literal subresult:number <- factorial x:number result:number <- multiply subresult:number, n:number - reply result:number + reply result:number ] # unit test -- cgit 1.4.1-2-gfad0