horse n = horseMoves 1 1 [[1,1]] (n+1) (n*n) notContained _ [] = True notContained x (y:ys) | x/=y = notContained x ys | x==y = False horseMoves _ _ out _ 1 = out horseMoves rx cx out n p | ry>0 && ry0 && cy0 && ry0 && cy0 && ry0 && cy0 && ry0 && cy0 && ry0 && cy0 && ry0 && cy0 && ry0 && cy0 && ry0 && cy