This is a complete C# project demonstrating the algorithm to determine which squares among many are in proximity to one another. Download the zipped archive and extract it to your Visual Studio projects directory. Or, if you have .NET 4.0 installed and simply want to observe the program in action, extract the executable from the /bin/ folder and run it.
download link