about summary refs log tree commit diff stats
path: root/archive/2.vm/console.mu
diff options
context:
space:
mode:
Diffstat (limited to 'archive/2.vm/console.mu')
-rw-r--r--archive/2.vm/console.mu16
1 files changed, 16 insertions, 0 deletions
diff --git a/archive/2.vm/console.mu b/archive/2.vm/console.mu
new file mode 100644
index 00000000..cc81c232
--- /dev/null
+++ b/archive/2.vm/console.mu
@@ -0,0 +1,16 @@
+# example program: reading events from keyboard or mouse
+#
+# Keeps printing 'a' until you press a key or click on the mouse.
+
+def main [
+  local-scope
+  open-console
+  {
+    e:event, found?:bool <- check-for-interaction
+    break-if found?
+    print-character-to-display 97, 7/white
+    loop
+  }
+  close-console
+  $print e, 10/newline
+]