From 9e751bb8c0cdf771d34c839cb6591d892b8e62de Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 7 Mar 2017 01:41:48 -0800 Subject: 3761 --- html/068random.mu.html | 53 +++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) (limited to 'html/068random.mu.html') diff --git a/html/068random.mu.html b/html/068random.mu.html index 1e6c0429..1518a617 100644 --- a/html/068random.mu.html +++ b/html/068random.mu.html @@ -15,14 +15,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color a { text-decoration: none; } a:hover { text-decoration: underline; } * { font-size: 12pt; font-size: 1em; } -.Delimiter { color: #800080; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } .muControl { color: #c0a020; } +.Delimiter { color: #800080; } .Special { color: #c00000; } -.Comment { color: #9090ff; } +.Conceal { color: #4e4e4e; } .Constant { color: #00a0a0; } .LineNr { color: #444444; } -.muRecipe { color: #ff8700; } -.muScenario { color: #00af00; } +.Comment { color: #9090ff; } --> @@ -61,10 +62,10 @@ if ('onhashchange' in window) { 2 local-scope 3 load-ingredients 4 { - 5 break-if generator - 6 # generator is 0? use real random-number generator - 7 result <- real-random - 8 return result, 0/false + 5 ¦ break-if generator + 6 ¦ # generator is 0? use real random-number generator + 7 ¦ result <- real-random + 8 ¦ return result, 0/false 9 } 10 result, fail?, generator <- read generator 11 ] @@ -76,20 +77,20 @@ if ('onhashchange' in window) { 17 # compute result-len, space to allocate in result 18 result-len:num <- copy 0 19 { -20 _, arg-received?:bool <- next-ingredient -21 break-unless arg-received? -22 result-len <- add result-len, 1 -23 loop +20 ¦ _, arg-received?:bool <- next-ingredient +21 ¦ break-unless arg-received? +22 ¦ result-len <- add result-len, 1 +23 ¦ loop 24 } 25 rewind-ingredients 26 result-data:&:@:num <- new number:type, result-len 27 idx:num <- copy 0 28 { -29 curr:num, arg-received?:bool <- next-ingredient -30 break-unless arg-received? -31 *result-data <- put-index *result-data, idx, curr -32 idx <- add idx, 1 -33 loop +29 ¦ curr:num, arg-received?:bool <- next-ingredient +30 ¦ break-unless arg-received? +31 ¦ *result-data <- put-index *result-data, idx, curr +32 ¦ idx <- add idx, 1 +33 ¦ loop 34 } 35 result <- new-stream result-data 36 ] @@ -102,14 +103,14 @@ if ('onhashchange' in window) { 43 5:num/raw, 6:bool/raw <- random source 44 7:num/raw, 8:bool/raw <- random source 45 memory-should-contain [ -46 1 <- 34 -47 2 <- 0 # everything went well -48 3 <- 35 -49 4 <- 0 # everything went well -50 5 <- 37 -51 6 <- 0 # everything went well -52 7 <- 0 # empty result -53 8 <- 1 # end of stream +46 ¦ 1 <- 34 +47 ¦ 2 <- 0 # everything went well +48 ¦ 3 <- 35 +49 ¦ 4 <- 0 # everything went well +50 ¦ 5 <- 37 +51 ¦ 6 <- 0 # everything went well +52 ¦ 7 <- 0 # empty result +53 ¦ 8 <- 1 # end of stream 54 ] 55 ] 56 @@ -128,7 +129,7 @@ if ('onhashchange' in window) { 69 source:&:stream:num <- assume-random-numbers 91 70 1:num/raw <- random-in-range source, 40, 50 71 memory-should-contain [ -72 1 <- 41 +72 ¦ 1 <- 41 73 ] 74 ] -- cgit 1.4.1-2-gfad0