Slitherlink puzzle solver and generator