From d4cb1a51dbc25e0240c2ccb2da54e30db5acae28 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 5 Oct 2015 18:13:20 -0700 Subject: 2244 --- 062array.mu | 12 ++++++------ chessboard.mu | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/062array.mu b/062array.mu index c54020c0..03348c3a 100644 --- a/062array.mu +++ b/062array.mu @@ -1,7 +1,7 @@ scenario array-from-args [ run [ - 1:address:array:location <- new-array 0, 1, 2 - 2:array:location <- copy *1:address:array:location + 1:address:array:character <- new-array 0, 1, 2 + 2:array:character <- copy *1:address:array:character ] memory-should-contain [ 2 <- 3 # array length @@ -17,21 +17,21 @@ recipe new-array [ capacity:number <- copy 0 { # while read curr-value - curr-value:location, exists?:boolean <- next-ingredient + curr-value:character, exists?:boolean <- next-ingredient break-unless exists? capacity <- add capacity, 1 loop } - result:address:array:location <- new location:type, capacity + result:address:array:character <- new character:type, capacity rewind-ingredients i:number <- copy 0 { # while read curr-value done?:boolean <- greater-or-equal i, capacity break-if done? - curr-value:location, exists?:boolean <- next-ingredient + curr-value:character, exists?:boolean <- next-ingredient assert exists?, [error in rewinding ingredients to new-array] - tmp:address:location <- index-address *result, i + tmp:address:character <- index-address *result, i *tmp <- copy curr-value i <- add i, 1 loop diff --git a/chessboard.mu b/chessboard.mu index a0bdb435..57c70a45 100644 --- a/chessboard.mu +++ b/chessboard.mu @@ -111,7 +111,7 @@ recipe chessboard [ recipe new-board [ local-scope - initial-position:address:array:number <- next-ingredient + initial-position:address:array:character <- next-ingredient # assert(length(initial-position) == 64) len:number <- length *initial-position correct-length?:boolean <- equal len, 64 @@ -132,7 +132,7 @@ recipe new-board [ recipe new-file [ local-scope - position:address:array:number <- next-ingredient + position:address:array:character <- next-ingredient index:number <- next-ingredient index <- multiply index, 8 result:address:array:character <- new character:type, 8 @@ -200,7 +200,7 @@ recipe initial-position [ # B P _ _ _ _ p B # N P _ _ _ _ p n # R P _ _ _ _ p r - initial-position:address:array:number <- new-array 82/R, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 114/r, 78/N, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 110/n, 66/B, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 98/b, 81/Q, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 113/q, 75/K, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 107/k, 66/B, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 98/b, 78/N, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 110/n, 82/R, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 114/r + initial-position:address:array:character <- new-array 82/R, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 114/r, 78/N, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 110/n, 66/B, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 98/b, 81/Q, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 113/q, 75/K, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 107/k, 66/B, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 98/b, 78/N, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 110/n, 82/R, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 114/r #? 82/R, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 114/r, #? 78/N, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 110/n, #? 66/B, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 98/b, -- cgit 1.4.1-2-gfad0