diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-10-05 18:13:20 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-10-05 18:16:12 -0700 |
commit | d4cb1a51dbc25e0240c2ccb2da54e30db5acae28 (patch) | |
tree | 13cd20fb4954e50b0cd2e3f434c1437370d56ce0 | |
parent | 29057ed9e5c81aaa5b461d344ebdd7e713727965 (diff) | |
download | mu-d4cb1a51dbc25e0240c2ccb2da54e30db5acae28.tar.gz |
2244
-rw-r--r-- | 062array.mu | 12 | ||||
-rw-r--r-- | 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, |