function hitsTarget(vx, vy, [tLeft, tRight, tBottom, tTop]) {
let n = 0;
while (yPos(vy, ++n) > tTop) {}
let [x, y] = [xPos(vx, n), yPos(vy, n)];
while (y >= tBottom) {
if (x >= tLeft && x <= tRight) {
return 1;
}
n++;
[x, y] = [xPos(vx, n), yPos(vy, n)];
}
return 0;
}