previous

page 32

next
My Solution
store()
function store(arr) {
var x=Math.round(g_x/g_step);
var y=Math.round(g_y/g_step);
if (g_h==0) var l='v'+y+(y+1)+x;
if (g_h==90) var l='h'+(x-1)+x+y;
if (g_h==180) var l='v'+(y-1)+y+x;
if (g_h==270) var l='h'+x+(x+1)+y;
if (!arr.includes(l)) arr.push(l);
}
target()
function target() {
...
var nmbrs=g_pattern.split('');
g_fd0=[];
for (var i=0;i<4;i++) {
for (var j=0;j<5;j++) {
for (var k=0;k<nmbrs[j];k++) {
fd();
store(g_fd0);
}
rt();
...
run()
function run() {
...
g_fd1=[];
setTimeout(one_step,500);
}
previous
next