1 # example program: managing the display using 'screen' objects
 2 
 3 # The zero screen below means 'use the real screen'. Tests can also use fake
 4 # screens.
 5 def main [
 6   open-console
 7   10:char <- copy 97/a
 8   print 0/screen, 10:char/a, 1/red, 2/green
 9   1:num/raw, 2:num/raw <- cursor-position 0/screen
10   wait-for-event 0/console
11   clear-screen 0/screen
12   move-cursor 0/screen, 0/row, 4/column
13   10:char <- copy 98/b
14   print 0/screen, 10:char
15   wait-for-event 0/console
16   move-cursor 0/screen, 0/row, 0/column
17   clear-line 0/screen
18   wait-for-event 0/console
19   cursor-down 0/screen
20   wait-for-event 0/console
21   cursor-right 0/screen
22   wait-for-event 0/console
23   cursor-left 0/screen
24   wait-for-event 0/console
25   cursor-up 0/screen
26   wait-for-event 0/console
27   close-console
28 ]