mu/console.mu
Kartik K. Agaram 909adb27f9 3905
Standardize exit paths. Most layers now don't need to know about termbox.

We can't really use `assert` in console-mode apps; it can't just exit because
we want to be able to check assertion failures in tests.
2017-06-10 15:41:42 -07:00

17 lines
337 B
Plaintext

# 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
]