just run a spiral? it is not optimized at 100%, as te external circle will overlap a bit at the end, but it is the best for easy to write/debug (even visually).
For sensor it all depends on with kind of mine you are loking for. There are a lot of trick, like "minimum metal mine" (no metal detector will work on them) and so on.