blob: 766ebdb64f451d3bacd739da86b157c92d05936d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
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++] }
if (state == 2) {
while(1) {
print(2); state = check();
}
}
while(1) {
print(4); state = check();
if (!(state == 4)) {
break;
}
}
print(3); state = check();
while(1) {
print(1); state = check();
}
|