about summary refs log tree commit diff stats
path: root/081print.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-01-22 12:10:38 -0800
committerKartik K. Agaram <vc@akkartik.com>2017-01-22 12:10:38 -0800
commit79b72b04cd3adc99295630121b1ea238818f5d8b (patch)
treeb1b27ac019a1b46ef360f7736516f252f183fa8c /081print.mu
parentab6e672d4e0a0bf92254df59f0cd8c66492a8ad0 (diff)
downloadmu-79b72b04cd3adc99295630121b1ea238818f5d8b.tar.gz
3736 - support printing booleans
Diffstat (limited to '081print.mu')
-rw-r--r--081print.mu20
1 files changed, 19 insertions, 1 deletions
diff --git a/081print.mu b/081print.mu
index 77f295a5..487696c5 100644
--- a/081print.mu
+++ b/081print.mu
@@ -704,7 +704,25 @@ def print screen:&:screen, n:num -> screen:&:screen [
   screen <- print screen, s, color, bg-color
 ]
 
-# addresses
+def print screen:&:screen, n:bool -> screen:&:screen [
+  local-scope
+  load-ingredients
+  color:num, color-found?:bool <- next-ingredient
+  {
+    # default color to white
+    break-if color-found?
+    color <- copy 7/white
+  }
+  bg-color:num, bg-color-found?:bool <- next-ingredient
+  {
+    # default bg-color to black
+    break-if bg-color-found?
+    bg-color <- copy 0/black
+  }
+  n2:num <- copy n
+  screen <- print screen, n2, color, bg-color
+]
+
 def print screen:&:screen, n:&:_elem -> screen:&:screen [
   local-scope
   load-ingredients