Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
new and improved solution in Clear category for Escape by lolucky
import assert from "assert";
var {abs} = Math,
escape = ([W, H, D], [x, y, vx, vy], hp = 20) => {
while(hp--){
var ey = H*+(vy>0), ex = W*+(vx>0),
m = vy/vx,
i = y-m*(x-ex)
x = abs(i)>ey ? x+(ey-y)/m : (vx*=-1,ex)
y = abs(i)
Nov. 25, 2020
Comments: