8
8
char *buffer = (char*)malloc(SIZE);
9
9
Relooper::SetOutputBuffer(buffer, SIZE);
11
Block *b0 = new Block("print('entry'); var label; var state; var decisions = [2, 2, 1, 3, 2, 2, 1, 3, 2, 3, 3, 1, 3, 2, 1]; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] }");
12
Block *b1 = new Block("print(1); state = check();");
13
Block *b2 = new Block("print(2); state = check();");
14
Block *b3 = new Block("print(3); state = check();");
15
Block *b4 = new Block("print(4); state = check();");
11
Block *b0 = new Block("print('entry'); var label; var state; var decisions = [2, 2, 1, 3, 2, 2, 1, 3, 2, 3, 3, 1, 3, 2, 1]; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] }", "the_var");
12
Block *b1 = new Block("print(1); state = check();", "the_var");
13
Block *b2 = new Block("print(2); state = check();", "the_var");
14
Block *b3 = new Block("print(3); state = check();", "the_var");
15
Block *b4 = new Block("print(4); state = check();", "the_var");
16
16
b0->AddBranchTo(b2, "state == 2");
17
17
b0->AddBranchTo(b4, NULL);
18
18
b1->AddBranchTo(b1, NULL);