Looks like the assertion checks provided in the code window are harder than the test problems, at least with respect to the snake trapping its head. I had this problem a lot with the provided assertion checks but not with the test problems. Also the first assertion check frequently gives an impossible problem - cherry in the first square on any move but the last.
Appreciate the problem and the cool graphics showing the snake move.
Created at: July 14, 2015, 3:26 a.m.; Updated at: July 20, 2015, 1:23 p.m.