about summary refs log tree commit diff stats
path: root/console.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-06-21 23:37:49 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-06-21 23:42:39 -0700
commit6a0f71b9f89df0940a342cd2c91d246cecc18bdf (patch)
tree9e5a926941a0be71e477bf6fe31ac48bc816d295 /console.mu
parent45c08fea47de1a23ce98f4fc7a1c5c3bed92b5fb (diff)
downloadmu-6a0f71b9f89df0940a342cd2c91d246cecc18bdf.tar.gz
1617
Diffstat (limited to 'console.mu')
-rw-r--r--console.mu14
1 files changed, 14 insertions, 0 deletions
diff --git a/console.mu b/console.mu
new file mode 100644
index 00000000..4e6c10a5
--- /dev/null
+++ b/console.mu
@@ -0,0 +1,14 @@
+# example program: reading events from keyboard or mouse
+#
+# Keeps printing 'a' until you press a key or click on the mouse.
+
+recipe main [
+  switch-to-display
+  {
+    _, found?:boolean <- check-for-interaction
+    break-if found?:boolean
+    print-character-to-display 97:literal, 7:literal/white
+    loop
+  }
+  return-to-console
+]