problem 11

walking a matrix in prolog is awkward