about summary refs log tree commit diff stats
path: root/078hash.cc
blob: 6577373de930903a174b750d6ff53d0577d1aca1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<
# example program: managing the display using 'screen' objects
#
# The zero screen below means 'use the real screen'. Tests can also use fake
# screens.

def main [
  open-console
  10:character <- copy 97/a
  print 0/screen, 10:character/a, 2/red
  1:number/raw, 2:number/raw <- cursor-position 0/screen
  wait-for-event 0/console
  clear-screen 0/screen
  move-cursor 0/screen, 0/row, 4/column
  10:character <- copy 98/b
  print 0/screen, 10:character
  wait-for-event 0/console
  move-cursor 0/screen, 0/row, 0/column
  clear-line 0/screen
  wait-for-event 0/console
  cursor-down 0/screen
  wait-for-event 0/console
  cursor-right 0/screen
  wait-for-event 0/console
  cursor-left 0/screen
  wait-for-event 0/console
  cursor-up 0/screen
  wait-for-event 0/console
  close-console
]
)) => 1 mem: ((5 integer)) => 3 run: read-key/main 7: nil => ((6 boolean)) mem: ((6 boolean)): 1106 <= nil run: read-key/main 8: (((jump-unless)) ((6 boolean)) ((1 offset))) mem: ((6 boolean)) => nil run: read-key/main 10: (((7 character)) <- ((index)) ((4 string-address) (deref)) ((3 integer-address) (deref))) mem: ((3 integer-address) (deref)) => 1 array-len: ((1031 string) (raw)) mem: ((1031 integer) (raw)) => 3 mem: ((1033 byte) (raw)) => o run: read-key/main 10: #\o => ((7 character)) mem: ((7 character)): 1107 <= #\o run: read-key/main 11: (((3 integer-address) (deref)) <- ((add)) ((3 integer-address) (deref)) ((1 literal))) mem: ((3 integer-address) (deref)) => 1 run: read-key/main 11: 2 => ((3 integer-address) (deref)) mem: ((3 integer-address) (deref)): 1066 <= 2 run: read-key/main 12: (((reply)) ((7 character))) mem: ((7 character)) => o run: main 4: #\o => ((1 character-address) (raw)) mem: ((1 character-address) (raw)): 1 <= #\o schedule: done with routine nil