Level generation algorithm with guaranteed path