-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvt220.js
45 lines (38 loc) · 888 Bytes
/
vt220.js
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
var display;
window.onload = function() {
display = createDisplay({
cols: 80,
rows: 25,
bgColor: "#222",
fgColor: "#d4992f",
font: "VT220",
fontSize: 20,
charWidth: 10,
charHeight: 20,
baselineOffset: 3,
border: 50,
borderColor: "#444",
borderRadius: 20,
caps: true
});
let output = {
println: display.println,
print: display.print
}
display.println("LUNAR LANDER BY JIM STORER")
display.println("FOCAL,1969")
display.println()
display.println()
let exec = lunarLander(output)
let process = function() {
result = exec.next()
if (result.done) {
return
}
display.input((line) => {
result.value.input = line
process()
})
}
process()
};