about summary refs log tree commit diff stats
path: root/apps/tests.subx
Commit message (Expand)AuthorAgeFilesLines
* 5924Kartik Agaram2020-01-271-5/+5
* 5897 - rename comparison instructionsKartik Agaram2020-01-161-6/+6
* 5883 - drop the `ref` keywordKartik Agaram2020-01-121-2/+2
* 5876 - address -> addrKartik Agaram2020-01-031-1/+1
* 5804Kartik Agaram2019-12-081-9/+9
* 5782 - fix a widespread bug with Heap-sizeKartik Agaram2019-11-301-1/+1
* 5715Kartik Agaram2019-10-261-2/+2
* 5700Kartik Agaram2019-10-171-1/+1
* 5698Kartik Agaram2019-10-151-3/+3
* 5695Kartik Agaram2019-10-031-1/+1
* 5675 - move helpers from subx-common into layersKartik Agaram2019-09-191-22/+22
* 5661Kartik Agaram2019-09-151-1/+1
* 5607Kartik Agaram2019-09-011-2/+2
* 5600Kartik Agaram2019-08-311-12/+14
* 5592 - switch register names to lowercaseKartik Agaram2019-08-261-82/+82
* 5589Kartik Agaram2019-08-251-0/+3
* 5485 - promote SubX to top-levelKartik Agaram2019-07-271-0/+279
23:38:16 -0800 committer Kartik K. Agaram <vc@akkartik.com> 2014-12-23 23:52:37 -0800 443 - simple graphics primitives' href='/akkartik/mu/commit/graphics.mu?h=hlt&id=ef55a4146609051c0a4cb1ca46693f620bd12118'>ef55a414 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23


                                                             
                                                            

                                                               
                                

                                                        




                                  
                                                  

                                                              
                                                  
                                                                

          
              
  
; open a viewport, print coordinates of mouse clicks
; currently need to ctrl-c to exit after closing the viewport
(function main [
  (window-on (("practice" literal)) 300:literal 300:literal)
  { begin
    (pos:integer-integer-pair click?:boolean <- mouse-position)
    (loop-unless click?:boolean)
    (x:integer <- get pos:integer-integer-pair 0:offset)
    (y:integer <- get pos:integer-integer-pair 1:offset)
;?     ($print (("AAA " literal)))
;?     ($print x:integer)
;?     ($print ((", " literal)))
;?     ($print y:integer)
;?     ($print (("\n" literal)))
    (print-integer nil:literal/terminal x:integer)
    (print-character nil:literal/terminal ((#\, literal)))
    (print-character nil:literal/terminal ((#\space literal)))
    (print-integer nil:literal/terminal y:integer)
    (print-character nil:literal/terminal ((#\newline literal)))
    (loop)
  }
  (window-off)
])