-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsource2.cgl
129 lines (124 loc) · 2.76 KB
/
source2.cgl
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
# no subroutines
my randval;
my rand = 1;
my shifted;
my x[4];
my y[4];
my xt[4];
my yt[4];
my deadboard[23];
deadboard[0] = 57351;
deadboard[1] = 57351;
deadboard[2] = 57351;
deadboard[3] = 57351;
deadboard[4] = 57351;
deadboard[5] = 57351;
deadboard[6] = 57351;
deadboard[7] = 57351;
deadboard[8] = 57351;
deadboard[9] = 57351;
deadboard[10] = 57351;
deadboard[11] = 57351;
deadboard[12] = 57351;
deadboard[13] = 57351;
deadboard[14] = 57351;
deadboard[15] = 57351;
deadboard[16] = 57351;
deadboard[17] = 57351;
deadboard[18] = 57351;
deadboard[19] = 57351;
deadboard[20] = 57351;
deadboard[21] = 65535;
deadboard[22] = 65535;
xt[0] = 6;
xt[1] = 7;
xt[2] = 7;
xt[3] = 8;
yt[0] = 20;
yt[1] = 20;
yt[2] = 19;
yt[3] = 19;
my collision;
do main {
while (collision < 1){
shifted = 1 << x[0];
deadboard[y[0]] &!= shifted;
shifted = 1 << x[1];
deadboard[y[1]] &!= shifted;
shifted = 1 << x[2];
deadboard[y[2]] &!= shifted;
shifted = 1 << x[3];
deadboard[y[3]] &!= shifted;
x[0] = xt[0];
y[0] = yt[0];
x[1] = xt[1];
y[1] = yt[1];
x[2] = xt[2];
y[2] = yt[2];
x[3] = xt[3];
y[3] = yt[3];
yt[0] = y[0] + 1;
yt[1] = y[1] + 1;
yt[2] = y[2] + 1;
yt[3] = y[3] + 1;
collision = deadboard[yt[0]] >>> xt[0];
shifted = deadboard[yt[1]] >>> xt[1];
collision |= shifted;
shifted = deadboard[yt[2]] >>> xt[2];
collision |= shifted;
shifted = deadboard[yt[3]] >>> xt[3];
collision |= shifted;
collision &= 1;
shifted = 1 << x[0];
deadboard[y[0]] |= shifted;
shifted = 1 << x[1];
deadboard[y[1]] |= shifted;
shifted = 1 << x[2];
deadboard[y[2]] |= shifted;
shifted = 1 << x[3];
deadboard[y[3]] |= shifted;
display = collision;
}
shifted = rand << 1;
rand ^= shifted;
shifted = rand >>> 5;
rand ^= shifted;
shifted = rand << 2;
rand ^= shifted;
randval = rand & 1;
if(randval == 0){
xt[0] = 6;
xt[1] = 7;
xt[2] = 7;
xt[3] = 8;
yt[0] = 2;
yt[1] = 2;
yt[2] = 1;
yt[3] = 1;
} else {
xt[0] = 6;
xt[1] = 7;
xt[2] = 7;
xt[3] = 8;
yt[0] = 1;
yt[1] = 2;
yt[2] = 1;
yt[3] = 2;
}
collision = deadboard[yt[0]] >>> xt[0];
shifted = deadboard[yt[1]] >>> xt[1];
collision |= shifted;
shifted = deadboard[yt[2]] >>> xt[2];
collision |= shifted;
shifted = deadboard[yt[3]] >>> xt[3];
collision |= shifted;
collision &= 1;
x[0] = xt[0];
y[0] = yt[0];
x[1] = xt[1];
y[1] = yt[1];
x[2] = xt[2];
y[2] = yt[2];
x[3] = xt[3];
y[3] = yt[3];
} while (collision < 1);