-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.jack
More file actions
39 lines (32 loc) · 943 Bytes
/
Main.jack
File metadata and controls
39 lines (32 loc) · 943 Bytes
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
class Main {
function void main() {
var Mover mover;
var Life life;
var int size, startLn;
var String startIn;
var Grid grid, moverOut;
var bool drawn;
var char key;
let size = Keyboard.readInt("Cell size? (>3) ");
let grid = Grid.new(size);
//debug checkpoint
// do Output.printString("grid created");
// do Sys.wait(3000);
do Screen.clearScreen();
// let startLn = Keyboard.readInt("Starting square?");
// do Screen.clearScreen();
let mover = Mover.new(grid);
while (~drawn) {
do mover.step();
let drawn = mover.done();
do Sys.wait(100);
}
let moverOut = mover.state();
let life = Life.new(moverOut);
while (true) {
do life.step();
// do Sys.wait(100);
}
return;
}
}