Version with rank 216 (out of 454)

Here is a big coefficient in value calculation (2^n), so the next way to improve is to find the optimum coef., or to rewrite the movement to direction vectors.