-
Notifications
You must be signed in to change notification settings - Fork 0
/
wireworld.html
243 lines (240 loc) · 19.1 KB
/
wireworld.html
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<!DOCTYPE html>
<html>
<head>
<title>Wireworld with html5 canvas</title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1"/>
<meta name="description" content="Wireworld simulation implemented with HTML5 canvas"/>
<link rel="canonical" href="https://rongjiecomputer.github.io/web-lab/wireworld.html">
<style>
p {
margin: 0 0 16px 0;
}
#board {
position: relative;
width: 500px;
height: 500px;
background-color: #000;
}
#canvas2 {
position: absolute;
pointer-events: none;
top: 0;
}
#data {
word-break: break-all;
}
@media (max-width: 515px) {
#board {
width: 300px;
height: 300px;
}
}
</style>
</head>
<body>
<h1>Wireworld with html5 canvas</h1>
<div id="board">
<canvas id="canvas"></canvas>
<canvas id="canvas2"></canvas>
</div>
<fieldset>
<legend>Panel</legend>
<p>
<label>Control</label>
<input type="button" onclick="play()" value="Play" id="btn">
<button onclick="reset()">Reset</button>
</p>
<p>
<label>Speed</label>
<select onchange="stop(); interval = parseInt(this.value);">
<option value="1000">Slow</option>
<option value="500">Default</option>
<option selected value="100">Fast</option>
<option value="50">Hyper</option>
</select>
</p>
<p>
<label>Cells</label>
<select onchange="stop(); cells = parseInt(this.value); SIZE = WIDTH / cells; draw(); drawLines();">
<option selected value="50">50</option>
<option value="100">100</option>
</select>
</p>
<p>
<label>Template</label>
<select onchange="stop(); external(pattern[parseInt(this.value)]);">
<option value="0">Blank</option>
<option selected value="1">Diode</option>
<option value="2">XOR-gate</option>
<option value="3">OR-gate</option>
<option value="4">NAND-gate 1</option>
<option value="5">NAND-gate 2</option>
<option value="6">Flip-flop</option>
<option value="7">Binary adder</option>
<option value="8">Complete circuit 1</option>
<option value="9">Binary adder n=6</option>
</select>
</p>
<p>
<label>More</label>
<button onclick="importdata()">Import</button>
<button onclick="exportdata()">Save</button>
</p>
</fieldset>
<div id="data"></div>
<script>
var grid = new Int8Array(105*105);
var newGrid = new Int8Array(105*105);
var cells = 50;
var SIZE = 10, WIDTH = 500;
var canvas = document.getElementById("canvas");
canvas.addEventListener("mousedown", function(e) {
if (isRunning) return;
var x = Math.floor(e.offsetX / SIZE)+1, y = Math.floor(e.offsetY / SIZE)+1;
grid[pos(x, y)] = (grid[pos(x, y)] + 1) % 4;
draw();
}, false);
if (window.innerWidth < 516) {
SIZE = 6; WIDTH = 300;
}
canvas.width = WIDTH;
canvas.height = WIDTH;
var context = canvas.getContext("2d");
context.fillStyle = "#C1FF86";
function pos(x, y) {
return 105*x+y;
}
var canvas2 = document.getElementById("canvas2");
var context2 = canvas2.getContext("2d");
canvas2.width = WIDTH;
canvas2.height = WIDTH;
context2.strokeStyle = "#929292";
function drawLines() {
context2.clearRect(0, 0, WIDTH, WIDTH);
context2.beginPath();
for (var i = 0; i <= cells; i++) {
context2.moveTo(0, i*SIZE);
context2.lineTo(WIDTH, i*SIZE);
context2.moveTo(i*SIZE, 0);
context2.lineTo(i*SIZE, WIDTH);
}
context2.stroke();
}
drawLines();
function main() {
for (var i = 1; i <= cells; i++) {
for (var j = 1; j <= cells; j++) {
switch (grid[pos(i, j)]) {
case 1:
var c = (grid[pos(i-1, j-1)] == 2) + (grid[pos(i-1, j)] == 2) + (grid[pos(i-1, j+1)] == 2)
+ (grid[pos(i, j-1)] == 2) + (grid[pos(i, j+1)] == 2) + (grid[pos(i+1, j-1)] == 2)
+ (grid[pos(i+1, j)] == 2) + (grid[pos(i+1, j+1)] == 2);
if (c == 1 || c == 2) newGrid[pos(i, j)] = 2;
else newGrid[pos(i, j)] = 1;
break;
case 2:
newGrid[pos(i, j)] = 3;
break;
case 3:
newGrid[pos(i, j)] = 1;
default:
}
}
}
var x = grid, y = newGrid;
grid = y;
newGrid = x;
newGrid.fill(0);
draw();
}
function draw() {
context.clearRect(0, 0, WIDTH, WIDTH);
for (var i = 1; i <= cells; i++) {
for (var j = 1; j <= cells; j++) {
if (grid[pos(i, j)]) {
switch (grid[pos(i, j)]) {
case 1:
context.fillStyle = "yellow";
break;
case 2:
context.fillStyle = "blue";
break;
case 3:
context.fillStyle = "red";
}
context.fillRect(SIZE*(i-1), SIZE*(j-1), SIZE, SIZE);
}
}
}
}
var isRunning = false, loop, interval = 100, btn = document.getElementById('btn');
function play() {
isRunning = !isRunning;
if (isRunning) {
loop = setInterval(main, interval);
btn.value = "Stop";
} else {
clearInterval(loop);
btn.value = "Play";
}
}
function stop() {
if (isRunning) {
clearInterval(loop);
isRunning = false;
btn.value = "Play";
}
}
function reset() {
stop();
context.clearRect(0, 0, WIDTH, WIDTH);
grid.fill(0);
}
function external(e) {
reset();
for (var i = 0; i < e.length; i += 3) {
grid[pos(e[i], e[i+1])] = e[i+2];
}
draw();
}
function importdata() {
stop();
var p = prompt("Please paste a previously saved data", "[10, 20, 1]");
if (p) {
try {
external(JSON.parse(p));
} catch (e) {
alert("The data is invalid!");
}
}
}
var dt = document.getElementById("data");
function exportdata() {
stop();
var data = [];
for (var i = 1; i <= cells; i++) {
for (var j = 1; j <= cells; j++) {
if (grid[pos(i, j)]) {
data.push(i);
data.push(j);
data.push(grid[pos(i, j)]);
}
}
}
dt.innerHTML = "<h4>Exported data</h4>" + "[" + data.join(",") + "]";
}
var pattern = [[],
[6,13,1,6,20,1,7,12,1,7,14,2,7,19,1,7,21,2,8,12,1,8,14,3,8,19,1,8,21,3,9,12,1,9,14,1,9,19,1,9,21,1,10,12,1,10,14,1,10,19,1,10,21,1,11,12,1,11,14,1,11,19,1,11,21,1,12,13,1,12,20,1,13,13,1,13,20,1,14,13,1,14,20,1,15,13,1,15,20,1,16,13,1,16,20,1,17,13,1,17,20,1,18,13,1,18,20,1,19,13,1,19,20,1,20,12,1,20,13,1,20,14,1,20,19,1,20,21,1,21,12,1,21,14,1,21,19,1,21,20,1,21,21,1,22,13,1,22,20,1,23,13,1,23,20,1,24,13,1,24,20,1,25,13,1,25,20,1,26,13,1,26,20,1,27,13,1,27,20,1,28,13,1,28,20,1,29,13,1,29,20,1,30,13,1,30,20,1],
[11,25,3,12,24,1,12,26,2,13,24,1,13,26,1,14,24,1,14,26,1,15,24,1,15,26,1,16,24,1,16,26,1,17,24,1,17,26,1,18,24,1,18,26,1,19,24,1,19,26,1,20,24,1,20,26,1,21,24,1,21,26,1,22,20,1,22,21,1,22,22,1,22,25,1,23,19,1,23,20,1,23,22,1,23,23,1,23,24,1,24,18,1,24,20,1,24,22,1,25,18,1,25,20,1,25,21,1,25,22,1,26,18,1,26,21,1,27,18,1,27,21,1,28,18,1,28,21,1,29,18,1,29,21,1,30,18,1,30,21,1,31,18,1,31,21,1,32,18,1,32,21,1,33,19,1,33,21,1,34,20,1],
[8,17,2,8,21,2,9,16,1,9,18,3,9,20,1,9,22,3,10,16,1,10,18,1,10,20,1,10,22,1,11,16,3,11,18,1,11,20,1,11,22,1,12,16,2,12,18,1,12,20,1,12,22,1,13,16,1,13,18,1,13,20,1,13,22,1,14,16,1,14,18,1,14,20,1,14,22,2,15,17,1,15,21,3,16,17,1,16,21,2,17,17,1,17,21,1,18,17,1,18,21,1,19,17,1,19,21,1,20,17,1,20,21,1,21,17,1,21,21,1,22,17,1,22,21,1,23,17,1,23,19,1,23,21,1,24,18,1,24,19,1,24,20,1,25,19,1,26,19,1,27,19,1,28,19,1,29,19,1,30,19,1,31,19,1,32,19,1,33,19,1],
[8,13,2,8,19,2,9,12,1,9,14,3,9,18,1,9,20,3,10,12,1,10,14,1,10,18,1,10,20,1,11,12,3,11,14,1,11,18,1,11,20,1,12,12,2,12,14,1,12,18,1,12,20,2,13,12,1,13,14,1,13,18,1,13,20,3,14,12,1,14,14,1,14,18,1,14,20,1,15,13,1,15,19,1,16,13,1,16,19,1,17,13,1,17,19,1,18,13,1,18,19,1,19,13,1,19,19,1,20,13,1,20,19,1,21,13,1,21,18,1,22,13,1,22,15,1,22,17,1,23,14,1,23,15,1,23,16,1,24,15,1,24,17,1,25,17,1,26,17,1,27,17,1,28,17,1,29,17,1,30,17,1,31,17,1,32,17,1,33,17,1],
[7,13,2,7,19,2,8,12,1,8,14,3,8,18,1,8,20,3,9,12,1,9,14,1,9,18,1,9,20,1,10,12,1,10,14,1,10,18,1,10,20,1,11,12,1,11,14,1,11,18,1,11,20,1,12,12,3,12,14,1,12,18,1,12,20,1,13,12,2,13,14,1,13,18,1,13,20,2,14,12,1,14,14,1,14,18,1,14,20,3,15,12,1,15,14,1,15,18,1,15,20,1,16,13,1,16,19,1,17,13,1,17,19,1,18,13,1,18,19,1,19,13,1,19,19,1,20,13,1,20,19,1,21,13,1,21,19,1,22,13,1,22,19,1,23,13,1,23,19,1,24,13,1,24,19,1,25,13,1,25,15,1,25,16,1,25,17,1,25,19,1,26,14,1,26,15,1,26,17,1,26,18,1,27,15,1,27,17,1,28,14,1,28,15,1,28,16,1,28,17,1,29,15,1,29,17,1,30,15,1,30,17,1,31,15,1,31,17,1,32,15,1,32,17,1,33,15,1,33,17,1,34,15,1,34,17,1,35,15,1,35,17,1,36,15,1,36,17,1],
[9,14,2,9,23,2,10,13,1,10,15,3,10,22,1,10,24,3,11,13,1,11,15,1,11,22,1,11,24,1,12,13,1,12,15,1,12,22,1,12,24,1,13,13,1,13,15,1,13,22,1,13,24,1,14,13,3,14,15,1,14,22,1,14,24,1,15,13,2,15,15,1,15,22,1,15,24,2,16,13,1,16,15,1,16,22,1,16,24,3,17,13,1,17,15,1,17,22,1,17,24,1,18,14,1,18,23,1,19,14,1,19,23,1,20,14,1,20,23,1,21,14,1,21,23,1,22,14,1,22,23,1,23,14,1,23,23,1,24,14,1,24,23,1,25,14,1,25,23,1,26,14,1,26,21,1,26,23,1,27,14,1,27,16,1,27,18,1,27,19,1,27,20,1,27,21,1,27,22,1,28,15,1,28,16,1,28,17,1,28,18,1,28,21,1,29,16,1,29,19,1,29,20,1,30,19,1,31,19,1,32,19,1,33,19,1,34,19,1,35,19,1,36,19,1,37,19,1,38,19,1],
[2,14,2,2,20,2,3,13,1,3,15,3,3,19,1,3,21,3,4,13,1,4,15,1,4,19,1,4,21,1,5,13,1,5,15,1,5,19,1,5,21,1,6,13,1,6,15,1,6,19,1,6,21,1,7,13,3,7,15,1,7,19,1,7,21,1,8,13,2,8,15,1,8,19,1,8,21,2,9,13,1,9,15,1,9,19,1,9,21,3,10,13,1,10,15,1,10,19,1,10,21,1,11,14,1,11,20,1,12,12,1,12,14,1,12,20,1,12,22,1,13,14,1,13,20,1,14,14,1,14,20,1,15,14,1,15,20,1,16,14,1,16,20,1,17,12,1,17,14,1,17,20,1,17,22,1,18,14,1,18,20,1,19,14,1,19,16,1,19,17,1,19,18,1,19,20,1,20,15,1,20,16,1,20,18,1,20,19,1,20,20,1,21,16,1,21,18,1,21,21,1,21,22,1,21,23,1,22,16,1,22,17,1,22,18,1,22,24,1,23,17,1,23,20,1,23,22,1,23,23,1,24,15,1,24,16,1,24,18,1,24,19,1,24,20,1,24,21,1,25,14,1,25,17,1,25,20,1,25,22,1,25,23,1,25,24,1,25,25,1,26,14,1,26,17,1,26,26,1,27,14,1,27,17,1,27,26,1,28,14,1,28,16,1,28,17,1,28,18,1,28,24,1,28,26,1,29,13,1,29,17,1,29,20,1,29,22,1,29,23,1,29,24,1,29,25,1,30,12,1,30,15,1,30,16,1,30,18,1,30,19,1,30,20,1,30,21,1,30,24,1,31,12,1,31,14,1,31,16,1,31,20,1,31,22,1,31,23,1,32,12,1,32,14,1,32,16,1,32,18,1,32,22,1,33,12,1,33,15,1,33,20,1,33,21,1,34,12,1,34,19,1,35,12,1,35,14,1,35,15,1,35,16,1,35,18,1,36,13,1,36,14,1,36,16,1,36,17,1,37,14,1,37,16,1,38,14,1,38,15,1,38,16,1,39,15,1,40,15,1,41,15,1,42,15,1,43,15,1,44,15,1,45,15,1,46,15,1,47,15,1,48,15,1,49,15,1],
[8,12,1,8,13,1,8,14,1,8,15,1,8,16,1,8,17,1,8,18,1,8,19,1,8,20,1,8,21,1,8,22,1,8,23,1,8,24,1,8,25,1,8,26,1,8,27,1,8,28,1,8,29,1,8,30,1,8,32,1,8,33,1,8,34,1,9,11,1,9,31,1,9,35,1,10,10,1,10,17,1,10,18,1,10,19,1,10,20,1,10,21,1,10,22,1,10,23,1,10,24,1,10,25,1,10,26,1,10,27,1,10,28,1,10,29,1,10,32,1,10,36,1,11,9,1,11,16,1,11,30,1,11,33,1,11,37,1,12,9,1,12,17,1,12,18,1,12,19,1,12,20,1,12,21,1,12,22,1,12,23,1,12,24,1,12,25,1,12,26,1,12,30,1,12,33,1,12,37,1,13,9,1,13,16,1,13,26,1,13,30,1,13,32,1,13,34,1,13,36,1,13,38,1,14,9,1,14,16,1,14,26,1,14,30,1,14,32,1,14,33,1,14,34,1,14,36,1,14,37,1,14,38,1,15,9,1,15,16,1,15,26,1,15,30,1,15,33,1,15,37,1,16,9,1,16,16,1,16,26,1,16,30,1,16,32,1,16,37,1,17,9,1,17,12,1,17,14,1,17,15,2,17,16,2,17,17,2,17,22,1,17,24,1,17,25,1,17,26,1,17,27,1,17,30,1,17,33,1,17,37,1,18,10,1,18,11,1,18,12,1,18,13,1,18,16,3,18,20,1,18,21,1,18,22,1,18,23,1,18,26,1,18,30,1,18,32,1,18,37,1,19,9,1,19,12,1,19,14,1,19,15,1,19,19,2,19,22,1,19,24,1,19,25,1,19,30,1,19,33,1,19,38,1,20,9,1,20,16,3,20,19,3,20,26,1,20,30,1,20,32,1,20,39,1,21,9,1,21,16,2,21,19,1,21,26,1,21,30,1,21,33,1,21,40,1,21,41,1,21,42,1,21,43,1,22,10,1,22,11,1,22,16,1,22,20,1,22,21,1,22,26,1,22,30,1,22,32,1,22,39,1,22,44,1,23,12,1,23,16,1,23,22,1,23,26,1,23,30,1,23,33,1,23,39,1,23,41,1,23,42,1,23,45,1,24,10,1,24,11,1,24,16,1,24,20,3,24,21,2,24,26,1,24,30,1,24,32,1,24,40,1,24,43,1,24,46,1,25,9,1,25,16,1,25,19,1,25,26,1,25,30,1,25,33,1,25,39,1,25,40,1,25,41,1,25,43,1,25,47,1,26,9,1,26,16,3,26,19,1,26,26,1,26,30,1,26,32,1,26,40,1,26,43,1,26,47,1,27,9,1,27,12,1,27,14,1,27,15,2,27,16,2,27,17,2,27,19,1,27,22,1,27,24,1,27,25,1,27,26,1,27,27,1,27,30,1,27,33,1,27,39,1,27,40,1,27,41,1,27,42,1,27,44,1,27,47,1,28,10,1,28,11,1,28,12,1,28,13,1,28,16,3,28,20,1,28,21,1,28,22,1,28,23,1,28,26,1,28,30,1,28,32,1,28,38,1,28,40,1,28,44,1,28,47,1,29,9,1,29,12,1,29,14,1,29,15,1,29,19,2,29,22,1,29,24,1,29,25,1,29,30,1,29,33,1,29,38,1,29,44,1,29,47,1,30,9,1,30,16,3,30,19,3,30,26,1,30,30,1,30,32,1,30,37,1,30,42,1,30,43,1,30,47,1,31,9,1,31,16,2,31,19,1,31,26,1,31,30,1,31,33,1,31,36,1,31,41,1,31,47,1,32,10,1,32,11,1,32,16,1,32,20,1,32,21,1,32,26,1,32,30,1,32,32,1,32,35,1,32,41,1,32,47,1,33,12,1,33,16,1,33,22,1,33,26,1,33,30,1,33,33,1,33,36,1,33,37,1,33,42,1,33,43,1,33,45,1,33,47,1,34,10,1,34,11,1,34,16,1,34,20,3,34,21,2,34,26,1,34,30,1,34,32,1,34,38,1,34,41,1,34,44,1,34,45,1,34,46,1,35,9,1,35,16,1,35,19,1,35,26,1,35,30,1,35,33,1,35,36,1,35,37,1,35,40,1,35,41,1,35,42,1,35,43,1,35,45,1,36,9,1,36,16,3,36,19,1,36,26,1,36,30,1,36,32,1,36,35,1,36,41,1,37,9,1,37,12,1,37,14,1,37,15,2,37,16,2,37,17,2,37,19,1,37,22,1,37,24,1,37,25,1,37,26,1,37,27,1,37,30,1,37,33,1,37,36,1,37,37,1,37,38,1,37,41,1,38,10,1,38,11,1,38,12,1,38,13,1,38,16,3,38,20,1,38,21,1,38,22,1,38,23,1,38,26,1,38,30,1,38,32,1,38,39,1,38,40,1,39,9,1,39,12,1,39,14,1,39,15,1,39,19,2,39,22,1,39,24,1,39,25,1,39,30,1,39,33,1,39,38,1,40,9,1,40,16,3,40,19,3,40,26,1,40,30,1,40,32,1,40,39,1,41,9,1,41,16,2,41,19,1,41,26,1,41,30,1,41,33,1,41,40,1,41,41,1,41,42,1,41,43,1,42,10,1,42,11,1,42,16,1,42,20,1,42,21,1,42,26,1,42,30,1,42,32,1,42,39,1,42,44,1,43,12,1,43,16,1,43,22,1,43,26,1,43,30,1,43,33,1,43,39,1,43,41,1,43,42,1,43,45,1,44,10,1,44,11,1,44,16,1,44,20,3,44,21,2,44,26,1,44,30,1,44,32,1,44,40,1,44,43,1,44,46,1,45,9,1,45,16,1,45,19,1,45,26,1,45,30,1,45,33,1,45,39,1,45,40,1,45,41,1,45,43,1,45,47,1,46,9,1,46,16,3,46,19,1,46,26,1,46,30,1,46,32,1,46,40,1,46,43,2,46,47,1,47,9,1,47,12,1,47,14,1,47,15,2,47,16,2,47,17,2,47,19,1,47,22,1,47,24,1,47,25,1,47,26,1,47,27,1,47,30,1,47,33,1,47,39,1,47,40,1,47,41,1,47,42,1,47,44,3,47,47,1,48,10,1,48,11,1,48,12,1,48,13,1,48,16,3,48,20,1,48,21,1,48,22,1,48,23,1,48,26,1,48,30,1,48,32,1,48,38,1,48,40,1,48,44,1,48,47,1,49,9,1,49,12,1,49,14,1,49,15,1,49,19,2,49,22,1,49,24,1,49,25,1,49,30,1,49,33,1,49,38,1,49,44,1,49,47,1,50,9,1,50,16,3,50,19,3,50,26,1,50,30,1,50,32,1,50,37,1,50,42,1,50,43,1,50,47,1,51,9,1,51,16,2,51,19,1,51,26,1,51,30,1,51,33,1,51,36,1,51,41,2,51,47,1,52,10,1,52,11,1,52,16,1,52,20,1,52,21,1,52,26,1,52,30,1,52,32,1,52,35,1,52,41,3,52,47,1,53,12,1,53,16,1,53,22,1,53,26,1,53,30,1,53,33,1,53,36,1,53,37,1,53,42,1,53,43,1,53,45,1,53,47,1,54,10,1,54,11,1,54,16,1,54,20,3,54,21,2,54,26,1,54,30,1,54,32,1,54,38,1,54,41,3,54,44,1,54,45,1,54,46,1,55,9,1,55,16,1,55,19,1,55,26,1,55,30,1,55,33,1,55,36,1,55,37,1,55,40,2,55,41,2,55,42,2,55,43,1,55,45,1,56,9,1,56,16,3,56,19,1,56,26,1,56,30,1,56,32,1,56,35,1,56,41,1,57,9,1,57,12,1,57,14,1,57,15,2,57,16,2,57,17,2,57,19,1,57,22,1,57,24,1,57,25,1,57,26,1,57,27,1,57,29,1,57,30,1,57,31,1,57,32,1,57,33,1,57,36,1,57,37,1,57,38,1,57,41,1,58,10,1,58,11,1,58,12,1,58,13,1,58,16,3,58,20,1,58,21,1,58,22,1,58,23,1,58,26,1,58,30,1,58,32,1,58,39,1,58,40,1,59,9,1,59,12,1,59,14,1,59,15,1,59,19,1,59,22,1,59,24,1,59,25,1,59,29,1,59,30,1,59,32,1,59,33,1,59,35,1,59,36,1,59,37,1,59,38,1,60,9,1,60,16,3,60,19,3,60,26,1,60,28,1,60,30,1,60,31,1,60,32,1,60,34,1,61,9,1,61,16,2,61,19,1,61,27,1,61,34,1,62,9,1,62,16,1,62,18,1,62,34,1,63,9,1,63,17,1,63,34,1,64,9,1,64,34,1,65,10,1,65,11,1,65,12,1,65,13,1,65,14,1,65,15,1,65,16,1,65,17,1,65,18,1,65,19,1,65,20,1,65,21,1,65,22,1,65,23,1,65,24,1,65,25,1,65,26,1,65,27,1,65,28,1,65,29,1,65,30,1,65,31,1,65,32,1,65,33,1],
[2,8,1,2,9,1,2,10,1,2,11,1,2,12,1,2,13,1,2,14,1,2,15,1,2,16,1,2,17,1,2,18,1,2,19,1,2,20,1,2,21,1,2,22,1,2,23,1,2,24,1,2,25,1,2,26,1,2,27,1,2,28,1,2,29,1,2,30,1,2,31,1,2,32,1,2,33,1,2,34,1,2,35,1,2,36,1,2,37,1,2,38,1,2,39,1,2,40,1,2,41,1,3,7,1,3,42,1,4,7,1,4,10,1,4,11,1,4,43,1,5,7,1,5,9,1,5,12,1,5,15,1,5,16,1,5,17,1,5,18,1,5,19,1,5,20,1,5,21,1,5,22,1,5,23,1,5,24,1,5,25,1,5,26,1,5,27,1,5,28,1,5,29,1,5,30,1,5,31,1,5,32,1,5,33,1,5,34,1,5,35,1,5,36,1,5,37,1,5,38,1,5,39,1,5,40,1,5,41,1,5,44,1,6,7,1,6,9,1,6,12,1,6,14,1,6,42,1,6,45,1,7,1,1,7,7,1,7,9,1,7,12,1,7,14,1,7,43,1,7,46,1,8,3,1,8,4,1,8,7,1,8,9,1,8,12,1,8,14,1,8,44,1,8,47,1,9,2,1,9,5,1,9,7,1,9,9,1,9,12,1,9,14,1,9,45,1,9,48,1,10,3,1,10,5,1,10,7,1,10,9,1,10,13,1,10,46,1,10,49,1,11,3,1,11,5,1,11,7,1,11,9,1,11,46,1,11,49,1,12,3,1,12,5,1,12,7,1,12,9,1,12,46,1,12,49,1,13,1,1,13,3,1,13,5,1,13,7,1,13,9,1,13,46,1,13,49,1,14,3,1,14,5,1,14,7,1,14,9,1,14,46,1,14,49,1,15,3,1,15,5,1,15,7,1,15,9,1,15,46,1,15,49,1,16,3,1,16,5,1,16,7,1,16,9,1,16,34,1,16,35,1,16,36,1,16,37,1,16,38,1,16,40,1,16,41,1,16,42,1,16,45,1,16,46,1,16,47,1,16,49,1,17,3,1,17,5,1,17,7,1,17,9,1,17,33,1,17,39,1,17,43,1,17,45,1,17,47,1,17,49,1,18,3,1,18,5,1,18,7,1,18,9,2,18,33,1,18,38,1,18,39,1,18,40,1,18,42,1,18,43,1,18,44,1,18,45,1,18,47,1,18,48,1,19,1,1,19,3,1,19,5,1,19,7,1,19,9,3,19,33,1,19,39,1,19,43,1,19,45,1,19,46,1,19,47,1,19,49,1,20,3,1,20,5,1,20,7,1,20,9,1,20,33,1,20,36,1,20,37,1,20,38,1,20,39,1,20,40,1,20,43,1,20,49,1,21,3,1,21,5,1,21,7,1,21,9,1,21,33,1,21,35,1,21,41,1,21,44,1,21,45,1,21,46,1,21,49,1,22,3,1,22,5,1,22,7,1,22,9,1,22,31,1,22,33,1,22,36,1,22,37,1,22,42,1,22,47,1,22,49,1,23,3,1,23,5,1,23,7,1,23,9,1,23,30,1,23,32,1,23,38,1,23,40,1,23,42,1,23,43,1,23,44,1,23,45,1,23,46,1,23,49,1,24,3,1,24,5,1,24,7,1,24,9,2,24,30,1,24,36,1,24,38,1,24,39,1,24,40,1,24,41,1,24,49,1,25,1,1,25,3,1,25,5,1,25,7,1,25,9,3,25,30,1,25,32,1,25,34,1,25,35,1,25,36,1,25,37,1,25,40,1,25,42,1,25,49,1,26,3,1,26,5,1,26,7,1,26,9,1,26,31,1,26,32,1,26,33,1,26,36,1,26,38,1,26,43,1,26,49,1,27,3,1,27,5,1,27,7,1,27,9,1,27,30,1,27,32,1,27,34,3,27,39,1,27,40,1,27,41,1,27,42,1,27,46,1,27,49,1,28,3,1,28,5,1,28,7,1,28,9,1,28,30,1,28,34,2,28,35,3,28,38,1,28,45,1,28,47,2,28,49,1,29,3,1,29,5,1,29,7,1,29,9,1,29,31,1,29,33,1,29,36,1,29,39,1,29,40,1,29,42,1,29,45,1,29,47,3,29,49,1,30,3,1,30,5,1,30,7,2,30,9,1,30,31,1,30,34,1,30,35,1,30,38,1,30,41,1,30,42,1,30,43,1,30,46,1,30,49,1,31,1,1,31,3,1,31,5,1,31,7,3,31,9,1,31,32,1,31,37,1,31,38,1,31,39,1,31,40,1,31,42,1,31,44,1,31,47,1,31,49,1,32,3,1,32,5,1,32,7,1,32,9,1,32,32,1,32,35,1,32,36,1,32,38,1,32,45,1,32,47,1,32,49,1,33,3,1,33,5,1,33,7,1,33,9,1,33,32,1,33,34,1,33,40,1,33,41,1,33,42,1,33,46,1,33,49,1,34,3,1,34,5,1,34,7,1,34,9,1,34,32,1,34,35,1,34,36,1,34,37,1,34,38,1,34,39,1,34,43,1,34,45,1,34,46,1,34,47,1,34,49,1,35,3,1,35,5,1,35,7,1,35,9,1,35,32,1,35,42,1,35,46,1,35,49,1,36,3,1,36,5,1,36,7,2,36,9,1,36,31,1,36,34,1,36,36,1,36,37,1,36,39,1,36,40,1,36,41,1,36,45,1,36,49,1,37,1,1,37,3,1,37,5,1,37,7,3,37,9,1,37,32,1,37,33,1,37,35,1,37,38,1,37,42,1,37,44,1,37,45,1,37,46,1,37,49,1,38,3,1,38,5,1,38,7,1,38,9,1,38,35,1,38,37,1,38,38,1,38,39,1,38,41,1,38,42,1,38,43,1,38,45,1,38,47,1,38,49,1,39,3,1,39,5,1,39,7,1,39,9,1,39,35,1,39,38,1,39,42,1,39,47,1,39,49,1,40,3,1,40,5,1,40,7,1,40,9,1,40,35,1,40,36,1,40,38,1,40,39,1,40,40,1,40,43,1,40,46,1,40,49,1,41,3,1,41,5,1,41,7,1,41,9,1,41,33,1,41,34,1,41,37,1,41,41,1,41,43,1,41,45,1,41,47,1,41,49,1,42,3,1,42,5,2,42,7,2,42,9,2,42,32,1,42,36,1,42,37,1,42,38,1,42,42,1,42,45,1,42,47,1,42,49,1,43,1,1,43,3,1,43,5,3,43,7,3,43,9,3,43,12,1,43,33,1,43,37,1,43,45,1,43,47,1,43,49,1,44,3,1,44,5,1,44,7,1,44,9,1,44,11,1,44,13,1,44,34,1,44,38,1,44,39,1,44,40,1,44,41,1,44,42,1,44,43,1,44,44,1,44,48,1,45,3,1,45,5,1,45,7,1,45,9,1,45,11,1,45,13,1,45,35,1,45,37,1,46,3,1,46,5,1,46,7,1,46,9,1,46,11,1,46,14,1,46,35,1,46,37,1,47,3,1,47,5,1,47,7,1,47,10,1,47,15,1,47,16,1,47,17,1,47,18,1,47,19,1,47,20,1,47,21,1,47,22,1,47,23,1,47,24,1,47,25,1,47,26,1,47,27,1,47,28,1,47,29,1,47,30,1,47,31,1,47,32,1,47,33,1,47,34,1,47,37,1,48,4,1,48,8,1,48,37,1,49,9,1,49,10,1,49,11,1,49,12,1,49,13,1,49,14,1,49,15,1,49,16,1,49,17,1,49,18,1,49,19,1,49,20,1,49,21,1,49,22,1,49,23,1,49,24,1,49,25,1,49,26,1,49,27,1,49,28,1,49,29,1,49,30,1,49,31,1,49,32,1,49,33,1,49,34,1,49,35,1,49,36,1]];
external(pattern[1]);
play();
</script>
</body>
</html>