Detects end tile and when it is off the line
Merge branch 'master' of https://github.com/agkphysics/Programs