diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-11-10 00:47:45 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-11-10 00:47:45 -0800 |
commit | e5e3640cfbfb7621c80c30a3f25eeae34c272322 (patch) | |
tree | 6438fd505994f4a167a3725b7b7e3128cc447dd9 | |
parent | 51b3503143ae9bd21feb33b470245ecc4f7beaa7 (diff) | |
download | mu-e5e3640cfbfb7621c80c30a3f25eeae34c272322.tar.gz |
4119
Running example programs after a long time.
-rw-r--r-- | 080display.cc | 2 | ||||
-rw-r--r-- | counters.mu | 4 | ||||
-rw-r--r-- | display.mu | 2 | ||||
-rw-r--r-- | static-dispatch.mu | 8 |
4 files changed, 12 insertions, 4 deletions
diff --git a/080display.cc b/080display.cc index 295f86b4..6bf8e51d 100644 --- a/080display.cc +++ b/080display.cc @@ -116,7 +116,7 @@ case PRINT_CHARACTER_TO_DISPLAY: { int height = (h >= 0) ? h : 0; int width = (w >= 0) ? w : 0; int c = ingredients.at(0).at(0); - int color = TB_BLACK; + int color = TB_WHITE; if (SIZE(ingredients) > 1) { color = ingredients.at(1).at(0); } diff --git a/counters.mu b/counters.mu index f0e514d7..dfa3e765 100644 --- a/counters.mu +++ b/counters.mu @@ -16,9 +16,9 @@ def increment-counter outer:space/names:new-counter, x:num -> n:num/space:1 [ def main [ local-scope # counter A - a:space <- new-counter 34 + a:space/names:new-counter <- new-counter 34 # counter B - b:space <- new-counter 23 + b:space/names:new-counter <- new-counter 23 # increment both by 2 but in different ways increment-counter a, 1 b-value:num <- increment-counter b, 2 diff --git a/display.mu b/display.mu index efe7b842..c3844c4b 100644 --- a/display.mu +++ b/display.mu @@ -6,7 +6,7 @@ def main [ print-character-to-display 97, 1/red, 2/green 1:num/raw, 2:num/raw <- cursor-position-on-display wait-for-some-interaction - clear-line + clear-line-on-display move-cursor-on-display 0, 4 print-character-to-display 98 wait-for-some-interaction diff --git a/static-dispatch.mu b/static-dispatch.mu index 7aec6fa1..ccb3de6a 100644 --- a/static-dispatch.mu +++ b/static-dispatch.mu @@ -1,3 +1,11 @@ +# Example program showing how multiple functions with the same name can +# coexist, and how we select between them. +# +# Expected output: +# 4 +# 7 +# 7 + def test a:num -> b:num [ local-scope load-ingredients |